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
Post a Comment