Re: SYSDATE query

From: Joe <joedelmonte_at_yahoo.com>
Date: 8 Oct 2001 09:05:40 -0700
Message-ID: <3d0cf525.0110080805.4d3df1a0_at_posting.google.com>


cvanhilten_at_hotmail.com (Clive van Hilten) wrote in message news:<e5f19d69.0110080131.4bd36ecb_at_posting.google.com>...
> (running Oracle 8i release 8.1.6.0.0)
>
> I have a query that extracts certain information from a list of cash
> account transactions. I would like to amend the query to select only
> those transactions where transaction_date was in the last 31 days. I
> have seen some examples on the internet that talk about using
> round(sysdate), but still cannot get my query to work.
>
> I would be very grateful for any help with the query, which reads as
> follows:
>
>
> SELECT cash_transaction_id, cash_ledger_id, cash_amount,
> to_char(transaction_date, 'DD-MM-YY') as transaction_date
> FROM webcentre_t_cash_dealing
> WHERE cash_ledger_id = 'NAMS1001'
>
>
> Thank you.
>
> Clive van Hilten

Clive,
try this:

  SELECT cash_transaction_id, cash_ledger_id, cash_amount,   to_char(transaction_date, 'DD-MM-YY') as transaction_date   FROM webcentre_t_cash_dealing
  WHERE cash_ledger_id = 'NAMS1001'
  AND transaction_date between sysdate-31 and sysdate

Joe Received on Mon Oct 08 2001 - 18:05:40 CEST

Original text of this message