Results 1 to 6 of 6
  1. #1
    Stanislavnba is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2019
    Posts
    12

    I linked my tables and datatype changed from date to text ???

    Hello, I have an SQL server on one remote PC and my back end is there on an SQL server.
    My front end is access. I only have 3 PC with versions of the FE.
    Today the internet stopped and the IP of the server changed(nothing major so far) .
    So I just re-linked the tables on the other two FE (the 1st FE is on the server machine).



    The problem is that for some reason when I relinked the tables, the DATE does not come up as date and it comes as shorttext. Which screwes half the queries on the FE.
    Any idea how I can fix this ?

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    What was the datatype for the date fields in SQL Server?
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    Stanislavnba is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2019
    Posts
    12
    The datatype in SQl Server is (datetime2(0), null) it shows off as this 2019-12-14 00:00:00

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    That's what I thought.
    Datetime2 provides greater precision but isn't supported by Access.
    Unless you really need the extra precision, I suggest you change it to datetime in SS or use CAST as datetime.
    Alternatively in Access try using CDate(nameoftextfield)
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #5
    Stanislavnba is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2019
    Posts
    12
    I've fixed it , it was because of the ODBC driver , I used SQL Server , and it needs to be SQL Native Client 11.

  6. #6
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    Excellent. I didn't realise that would work.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 02-11-2019, 12:59 PM
  2. Replies: 2
    Last Post: 07-13-2016, 08:28 AM
  3. Replies: 1
    Last Post: 11-30-2015, 07:30 AM
  4. datatype date as text?
    By slimjen in forum Queries
    Replies: 36
    Last Post: 08-20-2014, 08:22 PM
  5. Showing Rich Text in Linked SQL Tables
    By EddieN1 in forum Access
    Replies: 0
    Last Post: 11-15-2011, 02:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums