15
Views
6
Comments
How to not display a nulldate() on Excel with Advanced Excel
Question

Hey all, using the Advanced Excel module I am currently trying to create a column where the cell type is "datetime" I am passing in the date value from the database but when opening the excel file, the nulldate values are not the OS nulldate they are: "1900-01-02". The problem I am trying to solve is actually that I don't want to show any date at all when the value passed in is a nulldate?



Screenshot 2024-07-03 111400.png
2024-07-03 11_20_09-Report_2024-07-03 11_19_43.xlsx - Excel.png
2025-09-21 06-51-05
Mohd Anees Mansoori

Hi,

You can check the date at the time of mapping like:

If(ReportRecords.Current.SettledDate = NullDate(),"",ReportRecords.Current.SettledDate)

or

If(ReportRecords.Current.SettledDate = "1900-01-02","",ReportRecords.Current.SettledDate)

Hope that is what you asked for.

Regards,

Anees Mansoori

UserImage.jpg
Isaiah Paget

Thanks for the quick response but the problem is that if I put an empty string value into the CellValue, it errors and says the "" is not a valid DateTime

2025-09-21 06-51-05
Mohd Anees Mansoori

Not sure what will you  get in excel but can give a try to 


If(ReportRecords.Current.SettledDate = NullDate(),TextToDateTime(""),ReportRecords.Current.SettledDate) 

or 

If(ReportRecords.Current.SettledDate = NullDate(),TextToDateTime(NullTextIdentifier()) ,ReportRecords.Current.SettledDate)


UserImage.jpg
Isaiah Paget

Ended up figuring this out, maybe it's not the most elegant solution 

cellValue: If(date = nulldate(), "", date)

cellType: If(date = nulldate(), "general", "datetime")

Screenshot 2024-07-03 121047.png
2025-09-21 06-51-05
Mohd Anees Mansoori

Just double check in excel output also. 


UserImage.jpg
Isaiah Paget

Yeah it works and even the cells that are supposed to be "general" are of type "date" which is what I wanted, I guess general is a sort of generic type.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.