Outputting Dates w/ SQL

Results 1 to 2 of 2

Thread: Outputting Dates w/ SQL

  1. #1
    Join Date
    Dec 1969
    Posts
    94

    Default Outputting Dates w/ SQL

    Hello,<BR> I need to know how to display the dates that don&#039t fall between a query. In other words, I have and arrival date and a departure date, and I need to know how to display the dates between a departure date and the next arrival date. How would be the best way to approach this problem?<BR>

  2. #2
    Vincent Chan Guest

    Default RE: Outputting Dates w/ SQL

    Hi there Marko,<BR>Give this a try :<BR>- get your arrival date and departure date.<BR>- set a variable to get the number of days between the dates, e.g. <BR><BR>days = datediff("d", [arrivaldate], [departuredate])<BR><BR>- then loop the following subroutine <BR><BR>turn = 0<BR>do until turn = days<BR> turn = turn + 1<BR> response.write dateserial(year([arrivaldate]), _<BR>month([arrivaldate]), day([arrivaldate])+turn)<BR>loop<BR><BR><BR>Hope this helps!

Posting Permissions

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