Questions tagged [isnull]

`ISNULL` is a SQL function that replaces NULL with the specified replacement value.

ISNULL is a SQL function that replaces NULL with the specified replacement value.

Reference

MSDN Article

637 questions
-1
votes
1 answer

How to use ISNULL or COALESCE function when using a PIVOT in MS SQL

I have a table with the below mentioned schema: InvoiceID int PK, Date datetime, Amount Money I now create a table which contains the Year, Month and Amount from the table above. Year | Month | Amount 2014 | Dec | 10 I then pivot this table…
Sid
  • 141
  • 2
  • 13
-1
votes
2 answers

postgres replace isnull with integer

I am trying to replace empty cells in a column (type int) with an integer. I am using Postgres. I have been able to replace them in a 'select' query using coalesce, but not sure how to alter the records permanently.
user3770062
  • 103
  • 1
  • 1
  • 9
-1
votes
1 answer

Replace null returned date with a DateTime.now with C# and Linq

I have a Linq Query like this var db = new Models.Mydb(); var model = from c in db.VW_myTable select new { COdUser = c.CodUser, Entrada = c.StartHour, Salida = c.EndHour, fecha = c.DATE }; When i get Null values in the DATE…
HHungria
  • 421
  • 4
  • 6
-1
votes
1 answer

Understanding the working of "IsNull" function in SQL

Access Code iif(Format(SUM(Field))='',0,SUM(Field)) SQL code IsNull(SUM(Field),0) As Amt In the Access Code statement it is clearly shown that the query has to run SUM function 2 times to get SUM and 0 if records are blank. But I want to know that…
Agent_Spock
  • 947
  • 2
  • 12
  • 36
-1
votes
1 answer

SQL Find the Max value of the sum of two columns

This is a two part question ... Firstly I'm stuck on the logic, the second part is a formatting. The question reads as such: Display all jobs and the maximum total pay (salary + commission) for each job. The table is called employee -- and the…
YelizavetaYR
  • 1,451
  • 5
  • 15
  • 30
-1
votes
2 answers

How to convert Null Date into Blank?

I have a table which I'd like to convert Null Date (my date format i.e 2014-02-12) to blank string but an error occurs whenever I do IsNull, I have mysql. Is there away to do it with isnull?
-1
votes
1 answer

use of IsNull with date

I have the following TSQL code: Declare @MyDate datetime Select @MyDate = ISNULL(T.requireddate, Convert(DateTime, '01/01/2013', 101)) from myTable T where T.somekey = somevalue Select @MyDate The output is NULL. Why isn't it 01/01/2013?
DeveloperM
  • 969
  • 7
  • 15
  • 26
-1
votes
4 answers

If null return 0

I am trying to modify this query to return a row with '0' printed in either one or all of the rows when no data is returned. I've tried using ISNULL() but I am not getting anywhere. SELECT DISTINCT SA.DELETED, PAT.VERSION,…
Ben
  • 153
  • 2
  • 5
  • 18
-2
votes
1 answer

Python: replace nulls with 0

What is the best way to replace all the null "NaN" values in a Python dataframe with the value 0? Also, is it possible to do this with a for loop?
-2
votes
2 answers

Check if all of the values of a multidimensionnal array is null

I've a multidimensionnal array like that, and I wan't to check if all of the "open_at" and "closed_at" values are NULL. array:7 [▼ 0 => array:2 [▼ 0 => array:2 [▼ "open_at" => null "closed_at" => "11:03" ] 1 => array:2 [▼ "open_at" =>…
Newo1t
  • 1
  • 1
-2
votes
1 answer

laravel sql update isnull with parameters variables

$variable = array("apple" , "orange" , null, "apple2"); DB::statement("UPDATE table1 SET field1= IsNull($variable[0],field1), field2=…
-2
votes
1 answer

Check for value is N/A

I am integrating an API and in some cases bonus field return value N/A and I want not to show N/A on the page.If the field has any text other than N/A then it shows the text. I tried this: if(trim($value) != "N/A" && !is_null($value)) { …
dev tester
  • 307
  • 6
  • 22
-2
votes
2 answers

SQL multiple Case when statement

I am trying to execute the below query. SELECT ABL.Address1 AS BillingAddress1, ABL.Address2 AS BillingAddress2, ABL.Address3 AS BillingAddress3, ABL.Address4 AS BillingAddress4, ABL.UnitNumber AS BillingUnitNumber, ABL.City AS…
unnikrishnan
  • 125
  • 1
  • 3
  • 9
-2
votes
1 answer

need help, bug in query select with isnull

i think this can be a bug in yii2, when i use: $query->select ("isnull(cba.HSLET,0)"); $query->join('INNER JOIN','cba','cba.id = regverification.cba_id'); yii miss create the sql sentence resulting in a error near: isnull(cba.HSLET, [0)]
Yordankis
  • 83
  • 6
-2
votes
2 answers

SQL Server - Query Joins using Case or IsNull

I had a scenario which I need to write a query. I had a Query1 which return hundreds of records with these four column names (batch_no, batch_name, class_no, class_name) based on some joins. I need to write a final query (Query2) to return columns…
user4872443
1 2 3
42
43