Skip to content

Tag: sql-server

C# select SQL query with parameter

I would like to migrate database from MS Access to SQL Server and I’m trying to modify my SQL queries. In MS Access they worked. I have this C# code: Connection method : SQL query is working but not returning rows. I guess that problem is a syntax of parameter in query. Can someone direct me? Answer You…

One Table Update

I want to update Price where PriceGroup = ‘PG1’ and Price is null, with the Price from the same ID but the PriceGroup is PG2. I have tried a few solution here but couldn’t find any with Where statement. PriceTable: Result will be: Answer Something like this? Tried with this data and this is …

SQL Server – Can’t change datetime to date

I have this sql which has some date format issue, problem is that I can freely change EndDate to whatever I want, but for StartDate I can’t seem to change it one bit, it always have this timestamp that I am trying to get rid of. Basically whatever I do in varchar, date or any format I just can’t c…