Timestamp to date with an Oracle database
Answered
I believe that to change a field data type from timestamp to a date, I need to create a Calculated Field at the View level in freehand SQL. Can anyone provide the SQL statement for an Oracle database please? I have tried several suggestions from Stack Overflow, but I get errors.
Thanks and regards
Paul
Hi Paul,
are you aware that you don't have use a Freehand SQL Calc Field? You can get Yellowfin to do it automatically by clicking the + button at the bottom of the Prepare screen, then selecting Date Function, then selecting Date as shown below:
I've just tested this an Oracle data source and it is working correctly. Please let me know if you have any issues with it.
regards,
David
Hi Paul,
are you aware that you don't have use a Freehand SQL Calc Field? You can get Yellowfin to do it automatically by clicking the + button at the bottom of the Prepare screen, then selecting Date Function, then selecting Date as shown below:
I've just tested this an Oracle data source and it is working correctly. Please let me know if you have any issues with it.
regards,
David
Hi David
Yes, but it did not help with my underlying problem. What I am trying to do is create a calculated field by adding
the date a guest arrives (a date)+
the number of nights' stay (numeric)=
the date a guest departs (date).
After using the function you suggested and then trying to create the calculated field, I get "Invalid data types, TIMESTAMP and NUMERIC for arithmetic operation PLUS". The new date field is still deemed to be a timestamp.
Any suggestions?
Regards
Paul
Hi David
Yes, but it did not help with my underlying problem. What I am trying to do is create a calculated field by adding
the date a guest arrives (a date)+
the number of nights' stay (numeric)=
the date a guest departs (date).
After using the function you suggested and then trying to create the calculated field, I get "Invalid data types, TIMESTAMP and NUMERIC for arithmetic operation PLUS". The new date field is still deemed to be a timestamp.
Any suggestions?
Regards
Paul
OK, I'll play around with it over here now and let you know what I find...
OK, I'll play around with it over here now and let you know what I find...
this is definitely working for me:
Have you tried that?
regards,
David
this is definitely working for me:
Have you tried that?
regards,
David
and then apply the Date format via Column Formatting:
and then apply the Date format via Column Formatting:
Hi David
Instead of '1' in cast(ipclass.startdate as date) + 1, what is the sql to add the 'no of nights' field? Something like
cast(ipclass.startdate as date) + (ipclass.numberofnights) ?
regards
Paul
Hi David
Instead of '1' in cast(ipclass.startdate as date) + 1, what is the sql to add the 'no of nights' field? Something like
cast(ipclass.startdate as date) + (ipclass.numberofnights) ?
regards
Paul
Or perhaps I just do the calculated field at the report level?
Or perhaps I just do the calculated field at the report level?
That is still working for me, here is my new calc field at the view level:
and here it is in a report (once again, with the Column Formatting changed from Timestamp to Date)
That is still working for me, here is my new calc field at the view level:
and here it is in a report (once again, with the Column Formatting changed from Timestamp to Date)
Hi Dave
Success! Worked a treat.
Thanks so much for the help. You can mark this one closed.
Regards
Paul
Hi Dave
Success! Worked a treat.
Thanks so much for the help. You can mark this one closed.
Regards
Paul
That's great news Paul, thanks for letting me know!
regards,
David
That's great news Paul, thanks for letting me know!
regards,
David
When I worked with Oracle db, I tried to use different Delphi and Oracle database connection
When I worked with Oracle db, I tried to use different Delphi and Oracle database connection
Replies have been locked on this page!