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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

BIGINT - STRING DATE FORMAT

one of the column in my MySQL db table is
"job_UTC_Time"  "BIGIINT" datatype - length 20
UTC_Time is in milliseconds.  for example: 1451427036333

By using the tMySQLInput, I need to qurey all the columns includting job_UTC_time.

The query should also include the where condition.
where job_UTC_Time >= context.start_date and job_UTC_Time <= context.enddate

context variables are defined as string and default vale is set as '2015-01-01 00:00:00' (start_date) and '2016-03-09 00:00:00' (enddate)

How can I compare BIGINT which hold data in milliseconds with start_date which is string?
I could not attach screenshots as this forum throws errors :The server was unable to save the uploaded file.

Labels (2)
1 Reply
Anonymous
Not applicable
Author

Hi 
Convert the string value to a Date, and get the millseconds using the method getTime(), try this:
"....where job_UTC_Time>="+(TalendDate.parseDate("yyyy-MM-dd HH:mm:ss",context.[color=#5b5b5d][font=Verdana, Helvetica, Arial, sans-serif] start_date)).getTime()+" and job_UTC_Time <="+[/font][/color](TalendDate.parseDate("yyyy-MM-dd HH:mm:ss",context.enddate)).getTime()

Regards
Shong