Forums
This topic is locked
DateCreated + x
Posted 08 Dec 2003 21:01:29
1
has voted
08 Dec 2003 21:01:29 Claudio Huyskens posted:
I am working on an ASP VB page that is connected to an Access DB. I can´t find a way to build a dynamic expiration date as "DateCreated + x" . x will be fixed to 14. My problem is to add a certain ´number of days to a date. I hope any of you have ideas. Thanks in advance.
Replies
Replied 08 Dec 2003 23:11:14
08 Dec 2003 23:11:14 Mark Bieganek replied:
The following code will return todays date, plus 14 days.
-----------
<%=DateAdd("d", 14, Date)%>
-----------
Use the following code if you need to only show records where the date value is within 14 days of todays date. Add it to your Recordset using the Advanced view.
-----------
WHERE DateCreated BETWEEN DateValue (Date()) AND DateValue (Date()) + '14'
-----------
NOTE: in the above WHERE statement, you will need to change the word "DateCreated" to match the name of the field that holds your date value in the database.
Hope that helps.
Mark
-----------
<%=DateAdd("d", 14, Date)%>
-----------
Use the following code if you need to only show records where the date value is within 14 days of todays date. Add it to your Recordset using the Advanced view.
-----------
WHERE DateCreated BETWEEN DateValue (Date()) AND DateValue (Date()) + '14'
-----------
NOTE: in the above WHERE statement, you will need to change the word "DateCreated" to match the name of the field that holds your date value in the database.
Hope that helps.
Mark
Replied 09 Dec 2003 01:16:38
09 Dec 2003 01:16:38 Claudio Huyskens replied:
It definitely helped,
Thanks
Claudio
Thanks
Claudio