Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

108
Views
Create date from integers in separate fields in athena aws

I'm super new to athena, so bear with me. I have data stored as integers in three separate columns for year, month and day, as such:

year   month   day
2020   7       10
2020   7       11
2020   7       12

I'd like to turn these three fields into one date. How do I do that?

Thanks in advance!

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

One method is:

select date_parse(cast(year * 10000 + month * 100 + day as varchar(255)), '%Y%m%d')

This should also work:

select date(year || '-' || month || '-' || day)
over 4 years ago · Santiago Trujillo Report

0

You have to use the concat() function. You can see the documentation here.

Depending of the format that you want to use, this can change.

concat(year, '-' , month , '-', day)
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!