working with dates

Results 1 to 5 of 5

Thread: working with dates

  1. #1
    sergio Guest

    Default working with dates

    i have a field with dates in my SQL DB. and i want my VB-Script to check for the records with certain dates. like say, i want to show all people from my DB whose birthdate is 4 of april and to take those records show them on the screen. can somebody tell me how to do this please.

  2. #2
    Eddie Campbell Guest

    Default RE: working with dates

    Don't use Vbscript to test the dates, simply use Sql to only return records that fall on that date. You can use DatePart() to sepicify the day and month to be selected, and then step trhought the recordset and response.write the results to screen.

  3. #3
    sergio Guest

    Default tell me more please

    thanks for your reply,<BR><BR>could you please tell me more on how to exactly do this?<BR><BR>

  4. #4
    Eddie Campbell Guest

    Default RE: tell me more please

    You can get info on using DatePart in the VbScript reference resource (see the link on the left of this page).<BR><BR>Once you have tried using that, then come back and ask a question if you still don&#039;t understand.

  5. #5
    Mirain Guest

    Default RE: working with dates

    do like that:<BR><BR>&#060;%&#039;connection to your database <BR> ....<BR> &#039;create a recordset<BR> ....<BR>%&#062;<BR>&#060;% sql="select * from yourdatabase where datadiff("day",startdate,enddate)=0%&#062;<BR>&#06 0;%&#039;run the sql<BR> ....<BR>%&#062;<BR><BR>your can use the function datediff<BR>

Posting Permissions

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