storing date and time

Liz_I3

Well-known Member
Joined
Dec 30, 2002
Messages
647
Office Version
  1. 2016
Platform
  1. Windows
Hi is it better to store date and time together in one field or as two separate fields? Some calculations will be require to determine startdate plus 5 business days
Thanks for you advice
Liz
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
I prefer a single field myself, since it is really part of the same field. There are ways of dropping the time component, when needed.

Dates are actually stored as integers (the number of days since 1/1/1900). So you can use the INT function to drop the decimal (time) piece, and format the result as a date, i.e.
Int(DateAdd("d",5,[MyDate]))
 
Upvote 0
ha
I'm working with a sql server database where all the datetimes are stored as text

so 3:15:49 PM on July 6 2015 is stored as
'2015070615154900'

pain in the butt
 
Upvote 0
I'm working with a sql server database where all the datetimes are stored as text

so 3:15:49 PM on July 6 2015 is stored as
'2015070615154900'
Yikes! Who designed that mess?
That is not the default behavior for SQL. SQL has DateTime fields, just like Access.
 
Upvote 0
Thanks Joe I will take your advice and go with a single field
 
Upvote 0
Yikes! Who designed that mess?
That is not the default behavior for SQL. SQL has DateTime fields, just like Access.

Omnicell - think ATM machines for meds
Omnicell

yeah, I don't know why they didn't just use the normal datetime fields

every time a med is issued / returned / stocked / wasted / counted
every time a user is added or updated
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,140
Members
448,551
Latest member
Sienna de Souza

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