Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
gervit14
Contributor
Contributor

Inconsistent Date field while fetching from csv to postgresSQL !!!

Hi Team,

I am using postgreSQL and trying to load a column from one table to another in the same db.

My source column is of VARCHAR type having date values. I am parsing this date and storing it in the target column as "yyyy-MM-dd" format in 'Date' datatype.

Problem: For some record the value is coming fine but for some records the date field is coming as one day before the actual date.

Conversion from string to date is as : 

row5.seniority_date==null || row5.seniority_date.isEmpty() || row5.seniority_date.equals(" ")? null : TalendDate.parseDate("yyyy-MM-dd",TalendDate.formatDate("yyyy-MM-dd",TalendDate.parseDate("yyyy-MM-dd HH:mm:ss",(row5.seniority_date))))

Please find attached screenshot for the same. Please help me to resolve this.

 

0683p000009M67M.png

Labels (2)
6 Replies
Anonymous
Not applicable

In case you are storing row5.seniority_date as varchar, I suggest you try :

TalendDate.parseDate("yyyy-MM-dd HH:mm:ss",row2.seniority_date)

I should normaly convert the varchar to date.
If you want to remove time, I suggest you first use StringHandling.LEFT(row2.seniority_date,10) to extract only date without time before convert to date
gervit14
Contributor
Contributor
Author

Still facing the same issue.


Anonymous
Not applicable

Hi @gervit14 ,

 

In that case can you please try TalendDate.parseDate("yyyy-MM-dd",row5.seniority_date.substring(0,10))

 

Thanks and Regards,

Subhadip

gervit14
Contributor
Contributor
Author

Hi Subhadip,

The issue still persists. Still I am getting inconsistent data.


Anonymous
Not applicable

I'm not sure it's date conversion the issue
gervit14
Contributor
Contributor
Author

Same I was thinking, may be postgres internal time zone need to be checked or something...