Change Windows Regional Date/Time setting 
Author Message
 Change Windows Regional Date/Time setting

I am working on setting dates/time fields in order.  My
table date field and time field appear correct in
formating and order.  But, when I create a recordset and
order by name & date/time.  It doesn't recognize that
10:00 AM comes before 1:00 PM.  It is treating it as a
string.  So, if I temporarily change the users regional
setting to military time, it should sort correctly.  

Or at the time of setting the recordset, can you format
the date/time field to something other than the Windows
Regional Setting?

Any other ideas are welcome too.

Thanks



Mon, 19 Sep 2005 06:03:19 GMT  
 Change Windows Regional Date/Time setting
You're not using the Format statement, are you? That does convert things to
strings.

If that's the problem, just stop using the Format statement for sorting
purposes.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele


Quote:
> I am working on setting dates/time fields in order.  My
> table date field and time field appear correct in
> formating and order.  But, when I create a recordset and
> order by name & date/time.  It doesn't recognize that
> 10:00 AM comes before 1:00 PM.  It is treating it as a
> string.  So, if I temporarily change the users regional
> setting to military time, it should sort correctly.

> Or at the time of setting the recordset, can you format
> the date/time field to something other than the Windows
> Regional Setting?

> Any other ideas are welcome too.

> Thanks



Mon, 19 Sep 2005 07:51:21 GMT  
 Change Windows Regional Date/Time setting


Quote:

> Or at the time of setting the recordset, can you format
> the date/time field to something other than the Windows
> Regional Setting?

Yes, and that's a _much_ more friendly approach that messing about with
some innocent user's Windows settings!

First approach: as Doug says, just sort on the DateTime value, not the
formatted string.

Second approach: if you have to format, then use a format that sorts
properly, and specify it explicitly rather than relying on Short Date or
whatever:

  yyyy-mm-dd hh:nn     or simply      hh:nn

You can see more help for Format settings in help, under the Format()
function or the Format Property.

Of course, some of us have our Windows set up already to show century
digits and leading zeroes, and don't them altering... <g>

HTH

Tim F



Tue, 20 Sep 2005 02:36:37 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Setting the Regional Date and Time Settings.

2. How Can I Change the Short Date Format At Regional Settings in Control Panel

3. How to change regional settings to Windows?

4. Dates, MaskedBox, Regional settings and short date

5. Dates, MaskedBox, Regional settings and short date

6. Need to set regional settings in Windows NT

7. How to set WINDOWS REGIONAL SETTING in VB

8. change the time&date format in windows

9. Regional settings Date BUG

10. Date format and regional settings

11. how to programmatically access regional date settings?

12. Regional DATE setting Question.

 

 
Powered by phpBB® Forum Software