A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Time Field: Sorts incorrectly



 
 
Thread Tools Display Modes
  #1  
Old June 14th, 2004, 05:23 PM
Iram
external usenet poster
 
Posts: n/a
Default Time Field: Sorts incorrectly

Hello,
I have created a table with a field called "Time". The Format is Medium Time with an Input Mask of 09:00\ LL;0;_


I have created the following records in the table:

8:00:00 AM
8:30:00 AM
9:30:00 AM
10:00:00 AM
10:30:00 AM
11:00:00 AM
11:30:00 AM
12:00:00 PM
12:30:00 PM
1:00:00 PM
1:30:00 PM
2:00:00 PM
2:30:00 PM
3:00:00 PM
3:30:00 PM
4:00:00 PM
4:30:00 PM
5:00:00 PM

Once I sort these times in a query or report they sort as:

1:00:00 PM
1:30:00 PM
10:00:00 AM
10:30:00 AM
11:00:00 AM
11:30:00 AM
and so on....

Even the Reports that sort by time don't sort correctly.
This table acts as a Combo Box table/query field in a master table.

Your help is greatly appreciated,
Iram/mcp

  #2  
Old June 14th, 2004, 06:50 PM
Roger Carlson
external usenet poster
 
Posts: n/a
Default Time Field: Sorts incorrectly

I am not seeing this behavior in my test file. Are you using the Format()
function in your query? That will convert you time to a string value and
will show the kind of behavior you describe.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org

"Iram" wrote in message
...
Hello,
I have created a table with a field called "Time". The Format is Medium

Time with an Input Mask of 09:00\ LL;0;_


I have created the following records in the table:

8:00:00 AM
8:30:00 AM
9:30:00 AM
10:00:00 AM
10:30:00 AM
11:00:00 AM
11:30:00 AM
12:00:00 PM
12:30:00 PM
1:00:00 PM
1:30:00 PM
2:00:00 PM
2:30:00 PM
3:00:00 PM
3:30:00 PM
4:00:00 PM
4:30:00 PM
5:00:00 PM

Once I sort these times in a query or report they sort as:

1:00:00 PM
1:30:00 PM
10:00:00 AM
10:30:00 AM
11:00:00 AM
11:30:00 AM
and so on....

Even the Reports that sort by time don't sort correctly.
This table acts as a Combo Box table/query field in a master table.

Your help is greatly appreciated,
Iram/mcp



  #3  
Old June 14th, 2004, 07:17 PM
Iram
external usenet poster
 
Posts: n/a
Default Time Field: Sorts incorrectly

Hello Again, Forgot to spell out the question:
How can I get it to sort correctly?
It looks like Access is not figuring out the correct sequential order but rather number logic.

Iram/mcp

"Iram" wrote:

Hello,
I have created a table with a field called "Time". The Format is Medium Time with an Input Mask of 09:00\ LL;0;_


I have created the following records in the table:

8:00:00 AM
8:30:00 AM
9:30:00 AM
10:00:00 AM
10:30:00 AM
11:00:00 AM
11:30:00 AM
12:00:00 PM
12:30:00 PM
1:00:00 PM
1:30:00 PM
2:00:00 PM
2:30:00 PM
3:00:00 PM
3:30:00 PM
4:00:00 PM
4:30:00 PM
5:00:00 PM

Once I sort these times in a query or report they sort as:

1:00:00 PM
1:30:00 PM
10:00:00 AM
10:30:00 AM
11:00:00 AM
11:30:00 AM
and so on....

Even the Reports that sort by time don't sort correctly.
This table acts as a Combo Box table/query field in a master table.

Your help is greatly appreciated,
Iram/mcp

  #4  
Old June 14th, 2004, 08:02 PM
Iram
external usenet poster
 
Posts: n/a
Default Time Field: Sorts incorrectly

I narrowed down the problem but I still need help...

I have a table "Master" and in that table one of the fields is called "Time".

In the properties of "Time" I have selected Text as the Data Type (Problem).

On the Lookup Tab of the Time field I have Combo Box, Table/Query, Table Name "tbl_Time".
So in essence Master is looking at tbl_Time for the time range.
The time also sorts well in the tbl_Time. And if I run a query off of this table directly the time range is OK.

But like I said the field Time on the Master table is set to Text as the Data Type.
This is the reason why its sorting as if it were text.
If I set the Data Type to Date/Time I can not pull the time range from the other table.
How can I get aroun this?

Iram/mcp









"Iram" wrote:

Hello,
I have created a table with a field called "Time". The Format is Medium Time with an Input Mask of 09:00\ LL;0;_


I have created the following records in the table:

8:00:00 AM
8:30:00 AM
9:30:00 AM
10:00:00 AM
10:30:00 AM
11:00:00 AM
11:30:00 AM
12:00:00 PM
12:30:00 PM
1:00:00 PM
1:30:00 PM
2:00:00 PM
2:30:00 PM
3:00:00 PM
3:30:00 PM
4:00:00 PM
4:30:00 PM
5:00:00 PM

Once I sort these times in a query or report they sort as:

1:00:00 PM
1:30:00 PM
10:00:00 AM
10:30:00 AM
11:00:00 AM
11:30:00 AM
and so on....

Even the Reports that sort by time don't sort correctly.
This table acts as a Combo Box table/query field in a master table.

Your help is greatly appreciated,
Iram/mcp

  #5  
Old June 14th, 2004, 08:46 PM
Iram
external usenet poster
 
Posts: n/a
Default Time Field: Sorts incorrectly

All taken care of.

I set the Master table, Time field to Date/Time Medium Time. Then I set the forms to query the Time Table to pull the time range and insert it into the table.

Iram/mcp





"Roger Carlson" wrote:

I am not seeing this behavior in my test file. Are you using the Format()
function in your query? That will convert you time to a string value and
will show the kind of behavior you describe.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org

"Iram" wrote in message
...
Hello,
I have created a table with a field called "Time". The Format is Medium

Time with an Input Mask of 09:00\ LL;0;_


I have created the following records in the table:

8:00:00 AM
8:30:00 AM
9:30:00 AM
10:00:00 AM
10:30:00 AM
11:00:00 AM
11:30:00 AM
12:00:00 PM
12:30:00 PM
1:00:00 PM
1:30:00 PM
2:00:00 PM
2:30:00 PM
3:00:00 PM
3:30:00 PM
4:00:00 PM
4:30:00 PM
5:00:00 PM

Once I sort these times in a query or report they sort as:

1:00:00 PM
1:30:00 PM
10:00:00 AM
10:30:00 AM
11:00:00 AM
11:30:00 AM
and so on....

Even the Reports that sort by time don't sort correctly.
This table acts as a Combo Box table/query field in a master table.

Your help is greatly appreciated,
Iram/mcp




  #6  
Old June 15th, 2004, 01:54 AM
Jeff Boyce
external usenet poster
 
Posts: n/a
Default Time Field: Sorts incorrectly

Iram

MS Access treats "Time" as a reserved word, naming a function. Also "Date"
and several others. Perhaps an issue you are running into is related to
Access' confusion about what you mean by naming a field "Time".

Also, Access treats a Date/Time field as a "point-in-time", not a duration.
If you have stored what you believe is "8:00:00 AM", you have actually
stored a date plus that time.


--
Good luck

Jeff Boyce
Access MVP

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:05 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.