+ Reply to Thread
Results 1 to 5 of 5

How to query by date format yyyy-mm-dd?

  1. #1
    Forum Contributor
    Join Date
    09-19-2016
    Location
    Alaska
    MS-Off Ver
    MS 2010, 2013, 2016
    Posts
    272

    How to query by date format yyyy-mm-dd?

    Hi guys

    I have a query where I was using
    Please Login or Register  to view this content.
    to pull all records for the prior month, it worked find until they changed the date from mm/dd/yyyy to yyyy-mm-dd, I can't seem to find the right code to pull up the correct records.
    Last edited by AccountingJ; 05-14-2020 at 12:14 PM.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,855

    Re: How to query by date format yyyy-mm-dd?

    Try using...
    Please Login or Register  to view this content.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Contributor
    Join Date
    09-19-2016
    Location
    Alaska
    MS-Off Ver
    MS 2010, 2013, 2016
    Posts
    272

    Re: How to query by date format yyyy-mm-dd?

    I get the "Data Type Mismatch in Criteria Expression" error. I looked at the table and the data type is "Short Text" instaed of Date/Time... and it won't allow me to change it

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,855

    Re: How to query by date format yyyy-mm-dd?

    Short text... so you can't use numeric comparison operator.

    What you can do is use SQL side query to convert column then use numeric operator on the expression.

    Something like below, assuming it's MS Access.
    Please Login or Register  to view this content.
    EDIT: 'can' should be can't in first sentence. Fixed.
    Last edited by CK76; 05-14-2020 at 11:04 AM.

  5. #5
    Forum Contributor
    Join Date
    09-19-2016
    Location
    Alaska
    MS-Off Ver
    MS 2010, 2013, 2016
    Posts
    272

    Re: How to query by date format yyyy-mm-dd?

    thank you, this helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 04-25-2019, 11:05 AM
  2. Convert Date format from Text format reading m/d/yyyy to dd/mm/yyyy
    By bridge4444 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-23-2017, 11:22 PM
  3. Macro to change Date Format mm-dd-yyyy to dd-mm-yyyy
    By sriku in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2014, 08:34 AM
  4. Replies: 8
    Last Post: 10-02-2013, 06:23 PM
  5. Replies: 7
    Last Post: 11-18-2012, 02:28 PM
  6. [SOLVED] Imported data contains strings dd.mm.yyyy how can I convert to date format dd/mm/yyyy inVB
    By Boormo in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-05-2012, 05:48 PM
  7. opening excel file -> date format problem: DD/MM/YYYY vs MM/DD/YYYY
    By yung in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2005, 09:06 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1