I have a datetime field (example: 08/06/2007 9:05:06AM) that I want to change so only the date is in a select statement (so I only get 08/06/2007). How do I write the expression?
I have to use Peoplesoft query manager to write my queries and it says that I can't use FROM as part of my expression. Thanks for replying to my post. I guess I'll have to find some kind of workaround.
I don't know exactly how your front end works, but you don't need to select the function from a table. You just apply it to your column in the normal select list e.g.
select
column1,
column2,
to_char(date_column, 'MM/DD/YYYY') as output_date,
...
from my_table
The point was to 'show' you the use of the formatting method. You hadn't mentioned the use of a third party reporting tool, you asked how to do it in a select statement - I showed you how to do it in a select statement. You'll need to refer to the 'Peoplesoft query manager' manual and read up on how to do it within the contraints of that tool. Maybe this can help?
Thanks all. I'm getting error messages for the expressions. I decided to do a workaround. In the query manager, it has a drop down box for expression type and date is an option. I didn't want to use the drop down option because the statement has <= to the date but I'm only getting the < date data. I thought if I could actually write the expression instead of using the drop down box then it might work. I just have to enter 1 day after the date I really want (i.e. so if I want data for 08/15 then I have to enter 08/16, even though, it has <=). Thanks again for taking the time to reply to my problem.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.