SQL datetime compare

Even though in Europe and everywhere in the world it makes perfect sense to use the month as the second of three items in the date. In the US and in this case, apparently, SQL’s date time is MM.DD.YYYY, so you’re going for the 15th month and 18th month Therefore you should use or

SQL Server Linked Server Example Query

The format should probably be: For example: DatabaseServer1.db1.dbo.table1 Update: I know this is an old question and the answer I have is correct; however, I think any one else stumbling upon this should know a few things. Namely, when querying against a linked server in a join situation the ENTIRE table from the linked server will likely be downloaded … Read more

SQL – WHERE (X, Y) IN (A, B)

Why not something simple like the following? WHERE (X = 1 AND Y = 2) OR (X = 5 AND Y = 6) … Or, if you’re looking for rows (based on your example) where Y should be X + 1, then: WHERE Y = X + 1 If you have thousands of OR clauses like the … Read more