22
Views
3
Comments
why excel cell read date values store null date values in database
Application Type
Reactive

I read the date by cell_read and inserted it into the database base field of type date, but it stored as 1900-01-01

what can I do to save the date correctly

if give this format it store null values TextToDate(FormatDateTime(TextToDate(Struc.Current.Start_DATE()),  "yyyy-MM-dd"))

help to achieve  this

Hi Shaik Asik,

OutSystems does not have the concept of NULL, instead it uses default values to represent "lack of a value". In your case, the default lack-of-a-value value for a Date is #1900-01-01# (also known as NullDate()). I won't go into the discussion of wether this is good or bad, it's just how the platform was designed and it was a conscious decision by OutSystems that they maintained for over 20 years.

If that date is valid in your context (as in you would want to be able to store and represent 1 Jan 1900 in your system as a valid value) then you may need to add another attribute to indicate whether the date attribute has a meaningful value or not (a boolean HasStartDate for instance).

Hope this helps!

https://www.outsystems.com/forums/discussion/81519/advanced-excel-read-date-and-store-it-into-db/

The above link same as my problem .

when i used this hard code it works 

TextToDate(FormatDateTime(TextToDate("2015-01-01"),  "yyyy-MM-dd"))


when i use the  value from Cell_Read it returns 1900-01-01

TextToDate(FormatDateTime(TextToDate(Satrt_Date),  "yyyy-MM-dd"))

Start_Date is the structure value "Tex"t Data type


structure values I got 

after assign to the base it will return a null date

Hi Shaik Asik,

The link you shared is specifically for the Advanced Excel forge asset, not built-in functionality. If your issue is regarding the use of that component, then this should be tagged with it in the first place (I can do it now if you'd like, just let me know).

Without knowing details about the asset's implementation, I vaguely remember that Excel data is stored locale-specific, so... could it be that the date format of the computer that saved the Excel file is different from YYYY-MM-DD and because of that the component cannot correctly parse the date (4-digit day would overflow, like the link's error indicates)?

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