sql procedure
-
SELECT DISTINCT ISNULL(CONVERT(VARCHAR,DR_TimeIn,103),'NOT CHECKED')AS DATE, DR_EmployeeID AS EMPID , EM_FirstName +' '+ isnull(EM_MiddleName,' ' )+' '+isnull(EM_LastName,' ') AS EMPNAME, FROM SG_Daily_Register to accept the null values of lastname and firstname...I used the 'isnull' which is not correct..Pls correct the procedure
-
SELECT DISTINCT ISNULL(CONVERT(VARCHAR,DR_TimeIn,103),'NOT CHECKED')AS DATE, DR_EmployeeID AS EMPID , EM_FirstName +' '+ isnull(EM_MiddleName,' ' )+' '+isnull(EM_LastName,' ') AS EMPNAME, FROM SG_Daily_Register to accept the null values of lastname and firstname...I used the 'isnull' which is not correct..Pls correct the procedure
Which database are we using here? SQL Server does have an isnull function. For oracle checkout nvl. And for mysql I found this discussion of ifnull http://forums.mysql.com/read.php?98,198593
Data Quality Tools and Data Profiling software
-
SELECT DISTINCT ISNULL(CONVERT(VARCHAR,DR_TimeIn,103),'NOT CHECKED')AS DATE, DR_EmployeeID AS EMPID , EM_FirstName +' '+ isnull(EM_MiddleName,' ' )+' '+isnull(EM_LastName,' ') AS EMPNAME, FROM SG_Daily_Register to accept the null values of lastname and firstname...I used the 'isnull' which is not correct..Pls correct the procedure
-
SELECT DISTINCT ISNULL(CONVERT(VARCHAR,DR_TimeIn,103),'NOT CHECKED')AS DATE, DR_EmployeeID AS EMPID , EM_FirstName +' '+ isnull(EM_MiddleName,' ' )+' '+isnull(EM_LastName,' ') AS EMPNAME, FROM SG_Daily_Register to accept the null values of lastname and firstname...I used the 'isnull' which is not correct..Pls correct the procedure
SELECT DISTINCT DECODE(DR_TimeIn, NULL,'NOT CHECKED',DR_TimeIn) as Date,
.............;If you are using Oracle DECODE if the best. OR for other Database Server:
SELECT IIf(TimeIn is null,'NOT CHECKED',TimeIn) AS [Date],
........;:thumbsup:
-
SELECT DISTINCT ISNULL(CONVERT(VARCHAR,DR_TimeIn,103),'NOT CHECKED')AS DATE, DR_EmployeeID AS EMPID , EM_FirstName +' '+ isnull(EM_MiddleName,' ' )+' '+isnull(EM_LastName,' ') AS EMPNAME, FROM SG_Daily_Register to accept the null values of lastname and firstname...I used the 'isnull' which is not correct..Pls correct the procedure
It looks like you just forgot to wrap EM_FirstName in an isnull. Otherwise I don't see why that wouldn't work with MSSQL.