Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Oct 2006
    Location
    Melbourne, Victoria, Australia
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SQL datetime (2003)

    Hi All,

    I am learning about migrating the backend of our Access dB to SQL server express 2005. I've upsized a table and can see the data OK using Access as the frontend. The problem is that now when I run a query (from front-end) designed to view the date of any modified data, it doesn't return any records.

    Here is the SQL view of the query:
    SELECT Left([DateRecordModified],10) AS ADate, tblMainTable.DateRecordModified, tblMainTable.ModifiedBy, tblMainTable.Deleted, tblMainTable.surname, tblMainTable.given, [surname] & ", " & [given] AS FullName
    FROM tblMainTable
    WHERE (((Left([DateRecordModified],10))=[Forms]![frmLoginDetails]![filterdate]))
    ORDER BY tblMainTable.DateRecordModified DESC;

    I am not sure, but I think the problem has to do with the way datetime is stored on the SQL server (ie. 2008-10-23 07:15:00) rather than 23/10/2008 7:15:00 .....??? The strange thing is when i look at the contents of the liked SQL table from within Access, the datetime fields show as 23/10/2008 7:15:00. Not sure why or what's happening. Any help would be muchly appreciated.

    thanks, Van

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: SQL datetime (2003)

    Does it help if you use CDate(Left([DateRecordModified],10)) instead of just Left([DateRecordModified],10)?

  3. #3
    2 Star Lounger
    Join Date
    Oct 2006
    Location
    Melbourne, Victoria, Australia
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL datetime (2003)

    Yes!

    Thanks muchly Hans

Posting Permissions

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