Subject | RE: [ib-support] SQL HOW TO |
---|---|
Author | Thomas Steinmaurer |
Post date | 2002-12-19T09:09:03Z |
> Re:how to select a date column from a table where the month is equal to thisUse the EXTRACT function. For example, if you want all records
> month.
>
> I like to select record from mytable where the field Tdate is this month.
>
> i know that to select the record with date that is today used
> select * from mytable where Tdate = 'today'
> how to select it for this month.
where TDate is in the current month, then you could try:
- Dialect 1 Database:
select * from mytable
where extract(month from Tdate) = extract(month from cast('today' as date));
- Dialect 3 Database:
select * from mytable
where extract(month from Tdate) = extract(month from current_date);
HTH,
Thomas Steinmaurer
IB LogManager 2.1 - The Logging/Auditing Tool for InterBase and Firebird
http://www.iblogmanager.com