remove seconds from date_time field

gdesreu

Active Member
Joined
Jul 30, 2012
Messages
318
I record the date and time I load records to the database. These times are critical for grouping data for our purposes, however when I load a large group of data, the seconds are also entered which nullifies the purpose of the field because the seconds make the field unique and when I query using distinct I get multiple times for a group of data instead of one. If I format the field to say mm/dd/yyy hh:nn...looks ok when you are looking at it but the seconds are still stored and returned when clicking in the field or running distincts. Is there any way to prevent the seconds from being stored? For example default field value is =now() and format is mm/dd/yyy hh:nn, seconds are still there I want them gone forever or better yet never entered in the first place.
Thanks
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
when you insert the date hard code the seconds to 00

so
6/14/2017 11:22:35 am
would be
6/14/2017 11:22:00 am
I would prefer the :00 not to be there but that would work. I just tried this:
default field value = Format(Now(),"mm/dd/yyyy hh:nn")
This seems to do what I want. (I think....will need further testing with real data)
Thanks
 
Upvote 0

Forum statistics

Threads
1,221,691
Messages
6,161,309
Members
451,696
Latest member
Senthil Murugan

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