SQL VBA Dates Locales stuff

OK, for someone that knows this will be dead easy.

I need to be able to display the regional settings both for the logged in user and for the default system account. I don’t care how, vba would be best though.

I’ll explain why.

you all know I tinker with databases, I’m regarded locally as the guy to speak to as and when things don’t work, well one of the things I’ve had trouble with in the past is using SQL commands from within access, more specifically using dates, the dates get switched about if the user and system locales aren’t the same. I’m after a way of showing that they are not the same so I can go slap the IT people to get them to correct their slack ways.

coo that was hard…

Thank you to anyone in advance that can help

Well here is the skinny on this. System time is NOW() in 100% of the cases in Access, SQL, VB etc…The thing I’m wondering is well if you are logged in then that is the localized time setting regardless. So maybe what you would like is a requester from say the SQL server, and compare to logged in SQL correct? What I would do would be to have the server make the login points for time, then later take that logged in time for compare from the remote. I would in the login app just hold that say in a dat file, or access mdb.

Time is hard to track down and typically is a waste of time to monitor unless you’re billing it.

Maybe a little more detail I could lend more help… IM me

Not being particularly into this kind of thing… but would creating a routine that added two dates together and checked the result was how it was expected it to be work, i’m thinking if you add 12 days to 12/12/2009 we would expect 24/12/2009 but if it drops into the us format it would move the date to 12/12/2010.

Feel free to tell me not to be so stupid :chuckle:

Peige, your stupid…

OK so possibly not that stupid.

Greg, I’ll IM when I’m home from work, not allowed any form of IM at work :frowning:

Why are the system locales not all the same? Surely if a PC or laptop is being used in this country, the locale should be set to UK standard as a global thing anyway.

Is this of any use to you?

http://www.trigeminal.com/code/basIntlFormats.bas

The issue is when, how to update a feed from a server of current time, and format it on update to server in proper format. I think Adam and I sorted it out last evening but you would think the regional settings would hold true…but they don’t sometimes! I’m sure Adam will update the posting with what he did to sort it all out…ok back to folding, coding…eating (like the last one a little to much…LOL!)

Did a double cheat on this, the users found that if they entered a medium date ‘12 may 2009’ it would work, so, I forced the formatting to this, then in the SQL string I told it to traet the date as text so instead of wrapping the data in # to signify a date I wrapped it in ’ to signify just text, it would appear this has worked, but it’s a case of wait and see.

And just so your aware, it would be nice if all the baseunits were the same but this is the joy’s of outsourcing to a large consortium, that operate world wide, it wouldn’t supprise me if they used a master disk created in the US, anyone for Atrlas/EDS/fujitsu/HP want to comment?