How can I add one month to a date that I am checking under the where clause? e.g.: select * from Reference where reference_dt + 1 month
How do you get the 30 days before today in SQL.
I’m executing a INSERT to a sql 2008 db. How do I specify in T-SQL to insert NOW in a DATETIMEOFFSET column? GETDATE()?
I have a datetime column in SQL Server that gives me data like this 10/27/2010 12:57:49 pm and I want to query this column but just have SQL Server return the day month and year – eg. 2010 10 27 or something like that. What are the functions I should be researching? Should I be […]
Inside a SQL Server query, there is: datetime2(7). I know datetime2, but I don’t understand (7). Can you explain the meaning of (7)?
This question already has an answer here: How to return the date part only from a SQL Server datetime datatype 35 answers
In a table in my datatase I have a datatime column which stores the time at which the record is added. How can I delete all records which are older than a day when I run a stored procedure (considering the current time) ?
I am working on an SQL query which performs some arithmetic division on the data in a SQL Table based on the value in a date column. To elaborate I have the following SQL table Deals id Date Type Quantity Price 3 2014-11-04 Sweet 2500 23 9 2014-12-04 Sweet 5000 30 10 2014-12-04 Midale 2500 […]
I have a DATETIME Column in a table and I need to show the date in the following format “DD/MM/YYYY H:MM AM/PM” CreatedBy 2013-07-30 12:44:06.000 2013-07-30 12:45:57.000 2013-08-05 16:51:26.000 2013-08-05 19:08:18.000 2013-08-05 19:11:46.000 2013-09-12 12:44:27.000 I need the date like this–> “30/07/2013 12.44 PM”
How can I test two datetimes (not including their time components) for equality?