All,

I am somewhat confused by the way modern dbms handle timestamps. It seems as though date and time can be together in one field yet still be queried as if they were in different fields. Say I wanted to do a SELECT where time is between 1AM and 2AM. Is that possible if date and time are stored togeter in the same field?

Thanks,
-Bill

if you need to do a select on a specific time, i would keep them separate as it would be easier to do a search for some specific time rather than having to parse out the a string containing both the date and time

it would be easier to do a search for some specific time rather than having to parse out the a string containing both the date and time

Doesn't the dbms do the parsing for me when I specify just a time in my search? Part of the reason that I am asking this question is that I was told by an "expert" that date and time always go in the same field and the dbms easily figures out how to parse based on if the query is asking for a date range or a time range.

I'm trying to figure out if this is true or not.

-Bill

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.