Working with Dates (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


mutestar21 -> Working with Dates (6/17/2002 16:18:16)

Quick question about dates in ASP...

I have a product which expires after 6 weeks of a start date. Anyone have any suggestions how I would send the user a reminder after 5 weeks. I know how to work with ASPMail...that part is now problem.

The issue is working with the date fields.
How would I check if today's date is more than 5 weeks later than the start date in the db???

Thanks,
Bryan





Vince from Spain -> RE: Working with Dates (6/18/2002 15:39:31)

You can add and subtract dates in ASP, so for instance you could have a query like
sSQL="SELECT * FROM mytable WHERE datefield < #" & Date()-35 & "#"
(ie 35 being 35 days -> 5 weeks)
On SQL Server (as opposed to Access) the syntax would be
sSQL="SELECT * FROM mytable WHERE datefield < '" & Date()-35 & "'"

Vince

http://www.ibswebdesign.com/




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625