Good evening,
I am performing a simple query of a logic in db2 that is a numeric type but contains dates of the following format 20170831, but when performing the query both with 'between' and with the '>= <=' operators, it brings up all the existing dates.
The query is the following
SELECT NROP55, TIPL55, PBAE55, STAT1B, FIPL55 from
IVRDB2.S103V5HM.xxxx.xxxx
WHERE Fecha >= 20170801 AND Fecha <= 20170829
ORDER BY FIPL55 desc
The format is year, month, day and the result is always from the year 2014 or later.
Could you help me?
(I already used the quotes for the dates but it still gives the same result) Greetings
You need to use single quotes in your search:
If the date column is of type char (I want to assume that), you could use formats on the dates, such as:
If the date column is of a numeric type, you could try this query to see if it is what you are looking for.
I hope it helps you, greetings.