date stuff

Results 1 to 6 of 6

Thread: date stuff

  1. #1
    Join Date
    Dec 1969
    Posts
    940

    Default date stuff

    Hello,<BR><BR> I have a small project that I am working on for a client. They currently have some web-reports up and running using Powerbuilder. I have been given the task of converting that system into ASP. I have had no problems to date but I now ran into a wall. They have a form which allows them to search the database by date. There is a drop down menu box which gives them the following selections to select from:<BR><BR>1. Date Range Below<BR>2. This Week<BR>3. Last Week<BR>4. Month to Date<BR>5. Previous Month<BR>6. Year to Date<BR>7. Last Year<BR>8. Today<BR><BR><BR>I don&#039t know how I can get the "this week" and "last week" values. I have been playing around with the datepart function for VB and it seems to work great. Using this I can find out what the current week is, and the current day of the week is. I could try something like finding the current day of the week then subtracting from it but then what happens if the date is 6/03/99 and I go back 5 days, it won&#039t go back to 5/30/99. Please help, any suggestions are welcome.

  2. #2
    Join Date
    Dec 1969
    Posts
    119

    Default RE: date stuff

    I just tried this.<BR>If you just want to subtract a few days from a date. (Lets say todays date)<BR><BR>Date() gives todays date<BR>Date()-5 gives daye five days back<BR><BR><BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    119

    Default RE: date stuff

    I also tried this for a specified date<BR><BR>(CDate("6/03/99")-5)<BR><BR>it gives 5/29/99

  4. #4
    Karel Guest

    Default RE: date stuff

    Hi,<BR>everything you want to know about time/date conversions : <BR><BR>http://www.tcp-ip.com/WebLinks.asp?cat=ASPTime<BR><BR>Hope This helps<BR>Karel


  5. #5
    Karel Guest

    Default RE: date stuff

    Hi,<BR>everything you want to know about time/date conversions : <BR><BR>http://www.tcp-ip.com/WebLinks.asp?cat=ASPTime<BR><BR>Hope This helps<BR>Karel

  6. #6
    Branavank Guest

    Default RE: date stuff

    Try the dateadd function <BR>dateadd(1,1/6/99,"d")<BR>this function should return the date 1/6/99 plus 1 day.<BR>if the we had -1 then it would subtract a day. you can also change the "d" value to week,month or year.

Posting Permissions

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