Stripping Minutes From Hour When Only 00., Access 2010

jamiers

New Member
Joined
May 20, 2007
Messages
15
My supervisor wants me to create the following field. I need to merge fields and format to get it done.

Field 1: Date and Start Hour Training
Field 2: End Hour Training

New merged field...output should be something like this
Sa 9a-4p
M 9:30a-4:15p
Th 10:00a-1p

I have created a lookup for the day -- so I am not concerned about that... Look up Saturday, return Sa... look up Monday, return M.

But... what I can't figure out is how to dump the minutes if ONLY equal to 00 (9:00 should come back 9a, and 4:15 should come back as 4:15p).

This what I have going:
TrainingDayTime: [ShortDay] & " " & [TrainingRange]

Short Day is the lookup for the DayCode (Sa, Su, M, Th)
Training Rage field shows this expression: TrainingRange: Format([Start Date/Time],"h:nna/p") & "-" & Format([End Date/Time],"h:nna/p")

What can I do to those nn's to get them to only show if it is minute 01 to 59 and not 00?

I don't know anything about SQL or how to put it into a query field -- just want to say that FWIW
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Off the top of my head I think this would be as good as anything:
REPLACE(TrainingRange: Format([Start Date/Time],"h:nna/p") & "-" & Format([End Date/Time],"h:nna/p"),":00","")
 
Last edited:
Upvote 0
Cross-posted here: Stripping Minutes From Hour When Only 00., Access 2010

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule #13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0

Forum statistics

Threads
1,221,780
Messages
6,161,888
Members
451,730
Latest member
BudgetGirl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top