Wednesday, March 28, 2012

Subtracting Date in VB.Net

Need Help!

How do I write the following expression for my project limiting the number of entries on my datagrid by 30 days from Now():

<!--

SELECT * FROM tblGrid WHERE dateEntered between Now() - 30 and Now()

-->

note: dateEntered are the dates in my date field (mm-dd-yyyy)

Thanks a lot.

If you are using VB.NET, you can use DateTime.Add method. There's an exampe in the docs here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatetimeclassaddtopic.asp

0 comments:

Post a Comment