CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 1999
    Posts
    21

    Dates within SQL being a pain!

    Hi,

    I am using VB6 with a Microsoft Access ODBC database back end.

    I have a date within a particular table, formatted as dd/mm/yyyy (UK Format)

    When using a SQL query I do the following


    SELECT * FROM SOMETABLE WHERE MYDATE = 14/02/2000




    The database returns zero records even though I know that records are present which meet this criteria. I have tried different formats but with no luck

    Can anyone help?

    TIA

    Ian



  2. #2
    Join Date
    Nov 1999
    Location
    Italy
    Posts
    80

    Re: Dates within SQL being a pain!

    Have you tried this ?

    SELECT * FROM SOMETABLE WHERE MYDATE = 14022000



    Sometimes data is written without separatros.

    Something over there is coding....
    ... and you don't know!

  3. #3
    Join Date
    Dec 1999
    Posts
    21

    Re: Dates within SQL being a pain!

    Its ok, after an hour of trying I've worked it out!!!

    used # before and after my date criteria

    Ian


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

Featured