Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Problem with a date in the query !!

Re: Problem with a date in the query !!

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Sun, 25 Dec 2005 17:27:54 +0100
Message-ID: <43aec88b$0$14572$626a14ce@news.free.fr>

"gab" <gmessad_at_tiscali.fr> a écrit dans le message de news: domck9$38o$1_at_news.tiscali.fr...
| Thanks you very much for you help ,
|
| I will try to find some solution with the to_date function ,but do you know
| what is the query in SQL if I want to extract some date with the period
| date between the 01/04/( current year ) to the 31/03/( current year +1 )
| ( we call it in french accounting date ) .
|
| Thanks you for your help !!
|
|
|
| "Michel Cadot" <micadot{at}altern{dot}org> wrote in message
| news:43aea9b2$0$14550$626a14ce_at_news.free.fr...
| >
| > "gab" <gmessad_at_tiscali.fr> a écrit dans le message de news:
| dom3lp$rep$1_at_news.tiscali.fr...
| > | Hello !!
| > |
| > | I've got a problem with a query,I would like to select some data from "
| > | TbOrder"
| > | table where the period date is from the 01/04/(current year) to
| 31/March
| > | /( year +1 )
| > |
| > | This is my query but it's doesn't work :
| > |
| > | Select *
| > | from TbOrder a
| > | WHERE TO_CHAR(a.dat_cde,'DDMMYYYY')
| > | between TO_CHAR('0104'||TO_CHAR(SYSDATE,'YYYY'),'DDMMYYYY')
| > | to TO_CHAR('3103'||TO_CHAR(SYSDATE,'YYYY')+1,'DDMMYYYY')
| > |
| > |
| > | Could you help me for this probleme !
| > |
| > | Thanks
| > |
| > | Gab
| > |
| > |
| >
| > - "it does not work" is not a valid error message, giving the actual and
| complete error message helps to understand the problem
| > - often solution depends on Oracle version and it often help to know it to
| understand the problem
| > - sometimes solution depends on OS and its version, and it sometimes help
| to know them to understand the problem
| > - to_char(<string>) almost always leads to an error and is always a
| logical error
| > - in your case, use to_date(...) and this will work
| >
| > Regards
| > Michel Cadot
| >
| >
|

Regards
Michel Cadot Received on Sun Dec 25 2005 - 10:27:54 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US