Subject RE: [ib-support] SQL HOW TO
Author Thomas Steinmaurer
> Re:how to select a date column from a table where the month is equal to this
> 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.

Use the EXTRACT function. For example, if you want all records
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