Sunday, February 12, 2012

Calculating business day

Hi,

I am wondering what is vb.net method of calculating the prior business day (Monday - Friday).

For example, if today is Monday, Aug. 20, the last business day would have been Friday, Aug. 17.

I have a way to do this in SQL, but not vb.net.

Thanks much

I do hope someone can help me with this.

My problem is that I have to check the timestamps in some filenames to make sure I am loading the correct day's files.

So, on Monday 8/20/07, the files have a timestamp of 20070817, or last Friday. I need my code to be intelligent enough to detect when a day is Monday, so that it will get Friday's date, not Sunday's.

As I mentioned, I have a SQL server function that can do this, thanks to SQL Server's ability to know what day of the week it is, Monday, Tuesday, etc. Does vb.net have a similar functionality?

Thanks

|||

nevemind

datetime.today.dayofweek

|||

That will do it Smile

remember to mark posts as answered (even if you answer your own question)

No comments:

Post a Comment