cancel
Showing results for 
Search instead for 
Did you mean: 

Converting String to Date Type

0 Kudos

Hi,

I would like to have a simple query :

select ...

from ...

where lastmoddate between to_date('20080101','YYYYMMDD') AND to_date('20090101','YYYYMMDD')

The function to_date is not exist on MaxDB, Is there any similar function on MaxDB ?

If this kind of function is not exist on MaxDB, How else I can range between ddates ?

Many Thanks,

Ido

Accepted Solutions (1)

Accepted Solutions (1)

TTK
Employee
Employee
0 Kudos

Hi Ido

Please try following:

select * from ... where lastmoddate between {d '2008-11-26'} and {d '2008-11-27'}

FYI, there exists besides {d '...'} for date, {t '...'} for time and {ts '...'} for timestamp.

Example:


create table datetest2 (id int, d date)
insert into datetest2 values (1, now())
insert into datetest2 values (2, now())

select * from datetest2 where d between {d '2008-11-26'} and {d '2008-11-27'} 

Regards Thomas

Answers (2)

Answers (2)

0 Kudos

Thansk Thomas,

Its working.

Your answer was very helpfull.

Best Regards,

Ido

Former Member
0 Kudos

Hi,

did you try just to say

lastmoddate between '20080101' and '20090101'

?

I think, that should do.

Perhaps '20081231' would be better for the upper limit as it is inclusive.

Elke