SQL Function IFNULL

maretix

Member
Hi to all of you.

I need an help about SQL Function IFNULL

I need to test if a date is NULL, if not i need to obatin that date in the field, otherwise i need to put a dummy date..

Ex. IFNULL (prezzi.duc , '2000-01-01')

I write from Italy , is it correct to put '2000-01-01' to have 01/01/2000 or what do i need to write ???

I encounter error cause i have some records with prezzi.duc FIELD containing NULL dates.
I need to force NULL in something else.


Can you help me please ???

Have a good day.

Regards.
 

cj_brandt

Active Member
use ifnull function to determine if the field is null, if it isn't use an update statement to set the value of the field. IfNull isn't going to update the record.
 

maretix

Member
Hi Cj_Brandt.
Thanks for your kind reply.
Yes i read that IFNULL is used to determine if a filed is NULL or NOT.
I need to use IFNULL to force a value of a field but without doing an UPDATE..
I am using SSIS 2008 r2 to pull data from a Progress DB..
I have some date fileds with NULL value and i want to transform from NULL to a european (italian) dummy date ex. 2000-01-01 instead of reading NULL,

SELECT provoci.codpro,provoci.descpro , IFNULL(provoci.duc,<what format i need to put to have a 2000-01-01 date ???)>
FROM
pub.provoci

The result dataset will be directed in a SQL SERVER Table...(This is only a part of SSIS task).

Many thanks.
 
Top