check null or empty value in datetime field

Stimulsoft Reports.NET discussion
Post Reply
Vikas
Posts: 20
Joined: Sat Jul 31, 2010 4:12 am
Location: Delhi

check null or empty value in datetime field

Post 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
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

check null or empty value in datetime field

Post by Jan »

Hello,

You can use following expression to check null values:

Code: Select all

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