Re: SQL question on Dates
From: <champs_at_cbr.hhcs.gov.au>
Date: 1996/05/20
Message-ID: <1996May20.083557.1_at_cbr.hhcs.gov.au>#1/1
Date: 1996/05/20
Message-ID: <1996May20.083557.1_at_cbr.hhcs.gov.au>#1/1
In article <9605160927.AA37975_at_dsmit>, dgsmith_at_wb.xerox.com (David Smith) writes:
> I would think this would be relatively straight forward.
>
> How would I write the SQL to pull the current month's records without having
> to put modify the date in the criteria? Therefore on the first of the month
> it would automatically reset to pulling just that month's records.
>
> Thanks,
>
> Dave Smith
>
Something along the lines of:
Select <blah> from <table> where column_with_date between to_date('01'||to_char(sysdate,'mmyy'),'ddmmyy') and last_date(sysdate)
Bye for now.
Steven C.
Steven Champness champs_at_cbr.hhcs.gov.auDept of Health & Family Services Brisbane, Queensland, Australia These opinions are volatile and should be refrigerated before use Received on Mon May 20 1996 - 00:00:00 CEST