Skip to content

How to add date and time in SQL Server

I have two variables @date of type datetime and @time of type time. I want to add both to get another datetime variable. And I want to perform further calculations on it. Ex: Declare @date …

select where time = x or later

I have a table with columns username and timestamp . When a username is entered the current timestamp is as well. I would like to fetch the rows of all the new users from a certain time until now, but the start time varies. Lets make it a timestamp represented by x. I would like to use SQL to select

SQL : remove last comma in string

I have a text memo field in SQL table that I need to remove the last character in the field if it’s a comma. So, for example, if I have these rows, I need to remove the commas from rows 2 and 4. The output would be: Any ideas? Answer Using REVERSE and STUFF: First, you want to TRIM your