format time to [hh]:mm in a query (1 Viewer)

Arvin

I'm liv'in the dream ....
Local time
Yesterday, 23:17
Joined
Jul 22, 2008
Messages
192
Hello,

I would like to format the time to read as [hh]:mm in my query

Note *** I already have a "does not equal" value in the same query on the same colunm/field

How do I do this?

Thank you in advance
 

Atomic Shrimp

Humanoid lifeform
Local time
Today, 07:17
Joined
Jun 16, 2000
Messages
1,954
Add the field to your query again, move your criteria there and uncheck the 'show' box - then you're free to format the original column without interference - the criteria evaluation will be performed on the hidden, unformatted copy of the field.

You want to replace the field name with something like Format([yourfieldname],""hh:nn")

NB: Minutes are 'nn' because 'mm' means month.
 

Arvin

I'm liv'in the dream ....
Local time
Yesterday, 23:17
Joined
Jul 22, 2008
Messages
192
I just tried what you suggested and it didn't work

I'm getting "the expr you've entered has an invalid string" error
 

Arvin

I'm liv'in the dream ....
Local time
Yesterday, 23:17
Joined
Jul 22, 2008
Messages
192
this is what i have

Expr1: ([C30],"hh:nn")

and Access doesn't like the comma
 

Brianwarnock

Retired
Local time
Today, 07:17
Joined
Jun 2, 2003
Messages
12,701
Access doesn't like the fact that you didn't say Format, read mike's post again

Brian
 

Colin@Toyota

What's an Access?
Local time
Today, 02:17
Joined
May 2, 2006
Messages
203
try taking the double quotation out...
so... Format([YourField], "hh:nn")
 

Arvin

I'm liv'in the dream ....
Local time
Yesterday, 23:17
Joined
Jul 22, 2008
Messages
192
I'm an Idiot! .... it works now

I should have had this

Expr1: Format([C30],"Short Time")

and NOT

Format([C30],""hh:nn")


One last question ....I hope :) how would I go about adding/summing the time now .......

I know I know ....it never ends :)

Thank you in advance
 
Last edited:

Atomic Shrimp

Humanoid lifeform
Local time
Today, 07:17
Joined
Jun 16, 2000
Messages
1,954
Sorry about the double quote typo.

Formatting as 'short time' might be dependent upon Windows regional settings - I'm not aware of any places that use a different short time format, but it's customisable by the user or administrator, so it could happen.
 

DCrake

Remembered
Local time
Today, 07:17
Joined
Jun 8, 2005
Messages
8,632
Add a further column that reads

Mins:CInt((Left([C30],2) * 60 ) + Right([C30],2))

Then sum this column to give the total expressed in minutes

David
 

Arvin

I'm liv'in the dream ....
Local time
Yesterday, 23:17
Joined
Jul 22, 2008
Messages
192

DCrake

Remembered
Local time
Today, 07:17
Joined
Jun 8, 2005
Messages
8,632
Can you post a sample of you mdb to look at?
 

DCrake

Remembered
Local time
Today, 07:17
Joined
Jun 8, 2005
Messages
8,632
Here is a revised mdb I have built a cross tab query to generate the totals. This should get you on your way.

David
 

Attachments

  • ARVIN DEV.mdb
    344 KB · Views: 1,338

Arvin

I'm liv'in the dream ....
Local time
Yesterday, 23:17
Joined
Jul 22, 2008
Messages
192
Brilliant!

wow .... Thank you very much David ..... like really man .... and thank you all for assisting me .... this is SO appreciated

Bless you all! ! ! ! ! ! ! ! ! !
 

Arvin

I'm liv'in the dream ....
Local time
Yesterday, 23:17
Joined
Jul 22, 2008
Messages
192
I think I spoke to quick .....

Um .... maybe its me ( I think it is ) but ...when I switch to Pivot Table view and drop the fields I want .... it goes a lil crazy .... here is a screenshot

http://www.mts.net/~and0215/crosstab_pivot.jpg

Can someone tell what I'm doing wrong ?

Thank you in advance
 

DCrake

Remembered
Local time
Today, 07:17
Joined
Jun 8, 2005
Messages
8,632
Pivot tables are not my specialty, hopefully another member can assist.

David
 

Users who are viewing this thread

Top Bottom