Date and time search
Posted in 2006
Topics: General Discussion
Hi I'm having some trouble with an Informix Query
I hace the following:
select * from table1 where datefield >= '20112006' and datetimefield >='23:50' order by datefield, datetimefield
but instead of giving me the fields inserted after that date gives me
the fields inserted after that that but also after that hour ins this
example after 23:50 is ther other way to select the fields posterior to
these date and time???
Thanks a Lot
Luis Saavedra
HI I solve it by using something like this:
select * from table1 where datefield > '20112006' or idfield in
(select idfield from table 1 where datefield = '20112006' anddatetimefield >= '23:50') order by datefield, datetimefield
thanks if there's a more fficient way I'll appreciate it thanks
luissol wrote:
> Hi I'm having some trouble with an Informix Query
> I hace the following:
>
> select * from table1 where datefield >= '20112006' and datetimefield >=> '23:50' order by datefield, datetimefield
>
> but instead of giving me the fields inserted after that date gives me
> the fields inserted after that that but also after that hour ins this
> example after 23:50 is ther other way to select the fields posterior to
> these date and time???
>
> Thanks a Lot
> Luis Saavedra
On Tue, 2006-12-12 at 11:55 -0800, luissol wrote:
> HI I solve it by using something like this:
>
> select * from table1 where datefield > '20112006' or idfield in
> (select idfield from table 1 where datefield = '20112006' and> datetimefield >= '23:50') order by datefield, datetimefield
>
> thanks if there's a more fficient way I'll appreciate it thanks
What you have is fine if you're trying to get fired. Otherwise,
select * from table1 where datefield > '20112006' or (datefield =
'20112006' and datetimefield >= '23:50') order by datefield,datetimefield
should do the trick.
--
Carsten Haese | Phone: (419) 861-3331
Software Engineer | Direct Line: (419) 794-2531
Unique Systems, Inc. | FAX: (419) 893-2840
1687 Woodlands Drive | Cell: (419) 343-7045
Maumee, OH 43537 | Email: carsten@uniqsys.com