Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Help with ASP/mysql

Options
  • 18-11-2008 4:59pm
    #1
    Registered Users Posts: 7,405 ✭✭✭


    Hi All

    Just trying WHERE date < toDate to this SQL statement I have in a asp file
    SQL = "SELECT * FROM tableName WHERE date > '" & Request("fromDate") & "'"
    

    How do I do it??? I just keep getting errors.


Comments

  • Registered Users Posts: 610 ✭✭✭nialo


    What error are you getting?

    and is it not Request.Form("fromDate")


  • Registered Users Posts: 7,405 ✭✭✭fletch


    nialo wrote: »
    What error are you getting?
    I got it working in the end(typical, happens everytime I post on here)
    SQL = "SELECT * FROM tableName WHERE date >= '" & Request("fromDate") & "' AND date <= '" & Request("toDate") & "'"
    


  • Users Awaiting Email Confirmation Posts: 351 ✭✭ron_darrell


    Better to use the BETWEEN keyword as in:

    SQL = "SELECT * FROM tableName WHERE date BETWEEN '" & Request("fromDate") & "' AND '" & Request("toDate") & "';";


  • Registered Users Posts: 2,781 ✭✭✭amen


    is there a time portion in the date?

    in SQL Server if you use 18/11/2008 that really meants all records upto 18/11/2008 00:00:00am so be careful


Advertisement