sql server - Hardcode a specific day in data time while pulling the data - SQL -


actually have different date in sql table when pull via sql query, day of datetime field should have fixed day.

example: (dd-mm-yyyy) day should "7" > (7-mm-yyyy)

  • 10-08-2007 > 07-08-2007
  • 27-12-2013 > 07-12-2013
  • 01-03-2017 > 07-03-2017

can me on this. in advance.

find difference between 7 , day of original date , add original date:

select dateadd(day, 7 - day(originaldate), originaldate) 

Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

Command prompt result in label. Python 2.7 -