Page 1 of 1

check null or empty value in datetime field

Posted: Fri Aug 20, 2010 10:51 pm
by Vikas
Hi

I want to check the null or empty value in report to datetime field .

This is my statement.

Switch(
Hour(DownloadTourMaster.FinalDuration) * 3600 + Minute(DownloadTourMaster.FinalDuration) * 60+ Second(DownloadTourMaster.FinalDuration)
)

I am checking like this.

Switch(
(int)Hour(DownloadTourMaster.FinalDuration) >0,
Hour(DownloadTourMaster.FinalDuration) * 3600 + Minute(DownloadTourMaster.FinalDuration) * 60+ Second(DownloadTourMaster.FinalDuration)
)

But its not working because FinalDuration column type id datetime in DownloadTourMaster table.

How i do this check ?
Please help me.

Thanks
Vikas

check null or empty value in datetime field

Posted: Sun Aug 22, 2010 2:38 am
by Jan
Hello,

You can use following expression to check null values:

Code: Select all

(DownloadTourMaster["FinalDuration"] == null || DownloadTourMaster["FinalDuration"] == DBNull.Value)
Thank you.