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

  • Home
  • SEARCH
  • 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 6391405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:40:03+00:00 2026-05-25T03:40:03+00:00

So i have a query that is suppose to get me data from two

  • 0

So i have a query that is suppose to get me data from two tables. Which works fine so long as the date format is under the english(us) locale. When it is in an international formating the query gets an error when run and fails. the query is

        SELECT DISTINCT AlarmDet.Machine, AlarmDet.Job, 
AlarmDet.Mode, AlarmDet.User, AlarmDet.JobStart,
 AlarmDet.Object, AlarmDet.AlarmId, AlarmDet.AlarmStart, 
AlarmDet.MachineFault, AlarmDet.OperFault,
     AlarmDet.PiecesFed, Val(OperFault)+Val(MachineFault) AS AlarmStopTime, 
    (Mid(alarmdet.AlarmStart,5,7) & Right(alarmdet.AlarmStart,4) & Mid(alarmdet.AlarmStart,11,9)) AS AlarmTimeDate, 
    Mid(alarmdet.AlarmStart,12,2) AS AlarmHH, 
    Mid(alarmdet.AlarmStart,15,2) AS AlarmMM,
 Mid(alarmdet.AlarmStart,18,2) AS AlarmSS, 
CVDate((Mid([alarmdet].[AlarmStart],5,7) & Right([alarmdet].[AlarmStart],4))) AS AlarmDate, Alarms.ALARM_DESC
    FROM AlarmDet INNER JOIN Alarms ON AlarmDet.AlarmId = Alarms.id;

What the formulas in the query are doing is taking alarmstart (date) and splitting it up into seperate segments.

The section of the query that is causing an error when i step into it and attempt to run it is this:

CVDate((Mid([alarmdet].[AlarmStart],5,7) & Right([alarmdet].[AlarmStart],4))) AS AlarmDate

What i would like to know is, if there is a way in access to convert the formating of the query to be turnned in to US dateformating?
Or is there a better way to structure this part of the query in order to get it to run under an international formating?

Update

after spending some time and trying some of your suggestions, i’ve come up with this:

format(Mid([alarmdet].[AlarmStart],5,7) & right([alarmdet]![alarmstart], 4), "mm/dd/yyyy")

However, instead of getting mm/dd/yyyy, i get this:
mm-dd-yyyy.

Any thoughts as to why that is?

Update: again…

Nevermind, it appears that, that has to do with where your locale is set to.

Any suggestions or help is greatly 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-05-25T03:40:03+00:00Added an answer on May 25, 2026 at 3:40 am

    See whether the Format() function will allow you to display [AlarmStart] as you wish. Here are some sample expressions copied from the Immediate Window.

    ? Format(Date(), "yyyy/mm/dd")
    2011/08/29
    
    ? Format(Date(), "mmm d, yyyy h:nn:ss ampm")
    Aug 29, 2011 12:00:00 AM
    

    Edit: This is what I get in the Immediate Window using the example text value (“Tue Jan 18 10:10:57 2011”) you provided for [AlarmStart].

    ? Format(Mid("Tue Jan 18 10:10:57 2011", 5, 7) & _
        Right("Tue Jan 18 10:10:57 2011", 4), "mm/dd/yyyy")
    01/18/2011
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Linq2Sql query that looks like this: var data = from d
I have a query that I'm executing from a .NET application to a SQL
I have a query that works on Postgresql 7.4 but not on Postgresql 8.3
I have a query that pulls up questions from one table and answers from
suppose i have a query $array = array(); $sql = mysql_query(SELECT * FROM table);
I have a SQL query that is supposed to pull out a record and
I have a query that is dynamically built after looking up a field list
I have a query that originally looks like this: select c.Id, c.Name, c.CountryCode, c.CustomerNumber,
I have a query that looks like this: public IList<Post> FetchLatestOrders(int pageIndex, int recordCount)
I have a query that is currently using a correlated subquery to return the

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.