I need the date of two weeks ago.

Results 1 to 2 of 2

Thread: I need the date of two weeks ago.

  1. #1
    Try this One! Guest

    Default I need the date of two weeks ago.

    Along with the "present" todays date I need a way to get the date that is 14 days older that the "present" date.<BR>Stumped

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: I need the date of two weeks ago.

    Do you need to do this calculation in ASP or in a stored procedure or query in SQL?<BR><BR>In ASP:<BR>Dim dateToday, dateTwoWeeksAgo<BR>dateToday = Date<BR>dateTwoWeeksAgo = DateAdd("d",-14,dateToday)<BR><BR>The syntax is very similar in SQL.<BR>DateAdd(dd,-14,getdate())<BR><BR>(I think the dd is correct, you may need to check with SQL books online.)<BR><BR>Let me also suggest you read this article on 4Guys:<BR><BR>Date Functions in VBScript<BR>http://www.4guysfromrolla.com/webtech/110398-1.shtml<BR><BR>Happy Programming!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •