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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Help with ASP/mysql

  • 18-11-2008 3:59pm
    #1
    Registered Users, Registered Users 2 Posts: 7,423 ✭✭✭


    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, Registered Users 2 Posts: 610 ✭✭✭nialo


    What error are you getting?

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


  • Registered Users, Registered Users 2 Posts: 7,423 ✭✭✭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, Registered Users 2 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