I'm new to sql and need help on a query.
Database is JDEdwards In my database i have a column 'jdt' with Julian date stored as integer. Now i have to write a query to extract last 5 days data from the present day. My thinking approach is to convert current current date to Julian date as int and then juliandate-5
For example: Julian date=117209 i.e 2017-07-28 last 5 days date i.e 2017-07-23 -> 117204
I also have to do this in single query, i cannot add columns to existing table. And also this query needs t be generalized for every date i.e if i run this query it should automatically take that date of run.
Is my approach correct if yes, Please help me on the query. If there is a better approach please advise on this
TIA