Results 1 to 2 of 2

Thread: sql Parameters working with Dates

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    513

    sql Parameters working with Dates

    Hello: I have an sql query and am trying to use parameters and it looks like this:

    sql="Select * from tblTable where DateCreated Between ? and ?''

    When I run it, it passes through with no errors; however, it doesn't get any data so thinking I must not be doing something correctly due to the Between statement and using dates.

    Thanks,
    Proctor

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: sql Parameters working with Dates

    There is no inherent problem with dates and parameters, so presumably you are doing something wrong.

    The possibilities include not passing in dates (but strings that get converted to dates, which often goes wrong), putting the values in the wrong order, the field being text based rather than date based, and more.

    If you give us more details (such as the data type of the field, the code you use to add parameters, etc) we can hopefully work it out.

Posting Permissions

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



Click Here to Expand Forum to Full Width