Skip to content

Tag: sql

Is there any function in C# like isnull in SQL?

In SQL server we can use “isnull” function for example if Table1 Contains Field1 and only one record which Field1 is null we can write this Query: which returns “0”. can we use any function like this in C#? for Example Consider textBox1 is Empty. and I want to Show “0”. Ans…

SQL – Get result of current year only

How can I get the result of the current year using SQL? I have a table that has a column date with the format yyyy-mm-dd. Now, I want to do select query that only returns the current year result. The pseudo code should be like: The result should be as following: How can I do this? Answer Use YEAR() to

How to use substring and charindex in google query language

I have a google spreadsheet sheet with several columns: A: date B: string C: number … G: string (could be empty) H: string (could be empty) I would like to have a small table with the following: Get the sum of C in table, where rows are the values of G (substring of it, as they are configured as this:

SQL GetDate() returns wrong time

I am having an issue while using GetDate(), for some reason is not returning the right time (it is 7 hours ahead from the actual time) I am using AZURE and the Database is configured with the right location (West US). I will appreciate any help! I tried to run this script: Answer Azure SQL Databases are alway…

HANA: Split string?

Is there a way to split a string in HANA? Something similar to the equivalent in SQL Server: SELECT * FROM dbo.fnSplitString(‘valueA,valueB’, ‘,’)