Skip to main content
mk0724
September 19, 2024
Question

Date Field stored as null in database

  • September 19, 2024
  • 7 replies
  • 0 views

Hi everyone,

After importing the data from excel the values of date fields present in the excel are storing as null values in the datastore and in database too.

Any help here.

Thank you.

7 replies

kumara0180
September 19, 2024

How are you importing the data?

Can you share the code so that people can help further

mk0724
mk0724Author
September 19, 2024

Importing the data using datastore and readexcelsheet function. The data will be stored in 3 different tables. So first I am storing the data in datastore and again I am storing the data in different tables using readexcelsheet function.

somasundaram.d
September 19, 2024

By any chance are you having the column type in table as date?

mk0724
mk0724Author
September 19, 2024

Yes. The column type is date in table

somasundaram.d
September 19, 2024

Please change all the columns in the database table to varchar() then the import will succeed. And you will have all your data from excel in the staging table as text. Then you can manipulate the data as per your need.

mikes0011
Brainy
September 19, 2024

Agreed with Kumar - we need more detail.  When you say "importing the data from excel", what was the source of the excel data?  What data type were the date column(s) stored in?  What method did you use to "import" it?  How did you vet in advance that whatever import method you used would cast dates correctly from the format contained in the Excel file to the DB?

September 24, 2024

Hi,

this might be some format issue that happens with the excel. you can try by formatting that date column in the excel to date and then try uploading the excel sheet.