Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8708977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:15:19+00:00 2026-06-13T04:15:19+00:00

i am using the following expression to format a date in an msaccess query

  • 0

i am using the following expression to format a date in an msaccess query prior to exporting the data

Expr1: Right$([order details]![requested delivery date],4)+Mid$([order details]![requested delivery date],4,2)+Mid$([order details]![requested delivery date],1,2)

this picks up a general date from my table order details, (eg. 11/9/2012) and turns it into 20120911 or at least thats what i want it to do

unfortunately i an getting the output as 20129/11, which is a corruption i can not use

you can see that the 09 has been changed magically to 9/ and i dont understand how and why

can someone please advise what the correct expression should be, or if any change to the underlying data table is required.

i am using a general date format in the table –
this expression worked fine before but has now started to give me a problem since splitting the database and using attatched tables – msaccess version is 2003

any advice will be appreciated

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:15:19+00:00Added an answer on June 13, 2026 at 4:15 am

    It’s a very bad idea to manipulate dates from strings.

    For one, you have to deal with variation in the position of the month, such as “1/1/2012” and “10/10/2012”.
    Then you have to deal with the fact that the string returned by Access is highly dependent on the format specified for the column, and that format changes depending on the regional settings of the client.
    Additionally, Access understands and may return dates in US-format: m/d/yyyy.

    To solve your issues, explicitly use the date and formatting functions provided by SQL and Access to manipulate dates.
    In your case, I think you just need the Format() function:

    Format([order details]![requested delivery date], "yyyymmdd")
    

    Will return 20120911 if your [requested delivery date] is 11SEP2012.
    If your [requested delivery date] is defined as a string instead, make sure it contains valid dates, and convert it to a proper date, using CDate():

    Format(CDate([order details]![requested delivery date]), "yyyymmdd")
    

    If this column is set to allow Null values, you will need to test that:

    Iif(IsNull([order details]![requested delivery date]), Null, Format(CDate([order details]![requested delivery date]), "yyyymmdd"))
    

    Have a look at the following articles for more information on date manipulation:

    • Functions for calculating and for displaying Date/Time values in Access
    • Format function with Dates
    • List of functions in Access by category (go down to the Date category)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my repository implementation I can run the following query using a lambda expression:
I want to match a date-format in PHP using a regular expression. To keep
I am using the following Expression to select all hyperlinks //a[@href] How can I
I'm using the following regular expression to march hrefs on a web page. \/static\/workout\/[A-Z]{1,4}032812[A-Z]{1,5}-EQB.html
I am using the following code to pass a property to a lambda expression.
Following up to Regular expression to match hostname or IP Address? and using Restrictions
I'm trying to build s-expression objects using boost::proto with the following terminals: typedef proto::terminal<
Consider the following date string 2012-10-01 01:02:03.004+0500 This is recognized in Java using the
I have the following Regular Expression which matches an email address format: ^[\w\.\-]+@([\w\-]+\.)+[a-zA-Z]+$ This
I am looking at better way of writing following code using linq/lambda expression.. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.