hi
in oracle form , how i can return first day of the year for a given date
field name is : :BASIC_BLOCK.c_per
i found this function
SELECT TRUNC(to_date('17-DEC-2001'),'YEAR') "First Day" FROM Dual;
but it doesnt work when i replaced it like this
declare
begd date;
begin
SELECT to_date(:BASIC_BLOCK.c_per ,'Yyyy-mm-dd') into begd FROM Dual;
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
:basic_block.c_per is a date field and formatted as 'yyyy-mm-dd'
that one doesnt work also
Sean Stuber
>>> :basic_block.c_per is a date field and formatted as 'yyyy-mm-dd'
no
a date does not have a format
text has a format.
>>> that one doesnt work also
I gave 4 options, which "one" ?
and "doesn't work" in what way?
NiceMan331
ASKER
i didnt see your update for the comment
this one now works
begd := trunc(:BASIC_BLOCK.c_per,'yyyy');
but in the query , it required to be formatted as : yyyy-mm-dd
the form doesnt accept it
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Sean Stuber
in the form you are typing in text, that text must have a format, and then the form converts the text by that format into a date.
NiceMan331
ASKER
So , what would be the formula looks like ?
Sean Stuber
You have it already, since :basic_block.c_per is a date
that one doesnt work also