Home > database >  It is necessary to change a datetime type to type int in MSSQL?
It is necessary to change a datetime type to type int in MSSQL?

Time:11-22

Data about being,

Front desk features daily, weekly, monthly, annual report

Before the design of the database of the time is to use a datetime, statistics has the corresponding function, and more convenient to statistics,

A colleague recently proposed to a datetime int instead, use a Unix timestamp recording time,

My first thought is that if the statistical period, better statistics,

If the daily, weekly, monthly, annual report of the reentry after statistics will need to convert a datetime,

It is necessary to change excuse me?

CodePudding user response:

Into a timestamp query day, week, month or to use different function of statistics?

CodePudding user response:

Conversion is not recommended:
1, Unix time range is from 1970 to 2038, this time whether can accept,
2, switching back and forth beneath the efficiency, especially the time display in the report on the scene,
3, the front desk of the statements you have to modify (the strict testing)

CodePudding user response:

Don't need to feel a little tinkering,
  • Related