Skip to content

Tag: tsql

Query to update duplicates

I have the following query that returns duplicates that i am running on sql server. So I need to write a query that will update second instance of the email address based on the select query that retrieves dulicates to for example imports@rohnis.com to imports@rohnis.com.duplicate. If it is info@eps.ws then i…

Extract substring address SQL

I have a table with column Address which is like city. City_Name, citysector. CitySector, Street. Street_Name, StreetNumber. Street_Number EXAMPLE Address c. Paris, s. ParisDowntown, str. Rue Étienne Marcel, nr. 50 How can I substract 4 different columns like city, sector, street, streetNumber from Address co…

Find start date and end date from the employee time clock

I am trying to find out star date and end date for the employee time clock. Following is the example of the data I have. Output wanted: I have to find the start date and end date of the person based on eventtime and activitycode. The start date will be event time column and I have to calculate end date