Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    another date issue

    Hi all,

    ok...ASP and b****y dates!!

    I have a DB (access) with a number of records. Each record has a date inserted using the date() funtion (session.LCID=2057 so I get the UK format dd/mm/yyyy) which range from 03/03/2007 to 30/03/07.

    now, I'm trying to run a query that gives me a history of records over the last x number of days

    so I have

    numdays = request.form("numdays")
    datediff = date() - numdays
    strSQL = "SELECT record_id FROM historytbl WHERE record_date >#" & datediff & "#"

    so for 1 days the query string is

    SELECT record_id FROM historytbl WHERE record_date >#30/03/2007# (where today is 31)

    for 3 days...

    SELECT record_id FROM historytbl WHERE record_date >#28/03/2007# (where today is 31)

    etc etc

    this works fine until I get to 7 or more days...then I get an EOF or BOF is true error message.


    checking the query string...

    SELECT record_id FROM historytbl WHERE record_date >#24/03/2007# (where today is 31)

    so I can't see why this is failing...anyone any ideas??

  • #2
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok..apologies..ignore the above..the fault is somewhere else (running two queries in tandem and it's the second one that's falling over)

    sorry about that folks


  •  

    Posting Permissions

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