Results 1 to 2 of 2
  1. #1
    aero is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    12

    querying between datetime based on String Date in YYMMDD format


    I'm brand new to sql, vba, and access, but I have a basic knowledge of object oriented programming in java, and python. I am trying to do a query between two dates selected on a form. The "Report_Period" Column of the table in this database is a 10 digit String in "YYMMDD" format. Does anyone know the script/statement I can use to rearrange this string into something that a function like convert or cdate or some other function can use to convert either the entire column or at the very least, the selected dates into date time format that I can use to query from combo-box1 selection to combo-box2 selection using a <> statement ? Everything I've come across so far only works on DDMMYY formatted strings. Another possibility might be rearranging the string with left(), mid(), and right() and placing this inside a function like cdate, but I haven not been able to figure out the correct syntax for doing so. Any thoughts? I'm open to any and all suggestions, but please post the code if it works.
    Last edited by aero; 08-02-2014 at 01:05 PM. Reason: added stuff

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Here is a snippet that uses Left() and Mid() functions.
    https://www.accessforums.net/program...tml#post222674

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

Similar Threads

  1. Get only date from a datetime in access
    By scorpion99 in forum Queries
    Replies: 4
    Last Post: 11-30-2013, 09:43 AM
  2. Replies: 0
    Last Post: 10-11-2013, 06:07 AM
  3. Replies: 1
    Last Post: 07-23-2013, 01:39 AM
  4. Replies: 8
    Last Post: 01-16-2013, 02:10 PM
  5. format text string as date
    By rbrem in forum Access
    Replies: 2
    Last Post: 08-28-2012, 08:39 AM

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