Login
Register
Search
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Forums
Performance Management
Smart Notification
Display numeric as time
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Who's On?
Membership:
Latest:
Hitman
Past 24 Hours:
0
Prev. 24 Hours:
0
Overall:
5208
People Online:
Visitors:
288
Members:
0
Total:
288
Online Now:
New Topics
Lawson S3 HR/Payroll/Benefits
Post Tax Benefit Plan Table
11/14/2024 9:16 PM
Hi, totally new to Laswon. I have a repor
Lawson S3 Procurement
ED501 Error: Map 850 not supported by /law/c15vda/lawson/test10/edi/bin/laws_out_91
11/12/2024 3:47 PM
Tried runnning ED501 and getting the atathced erro
Lawson S3 HR/Payroll/Benefits
Error
11/6/2024 9:54 PM
When I try to enroll a retiree in 72.1 health plan
Infor ERP (Syteline)
Syteline: New Data Maintenance Wizard (Error) Need help
11/1/2024 4:24 PM
Hi, I need help with an error on syteline while us
Dealing with Lawson / Infor
Implementing Lawson v10 with Cerner Surginet, Case Cart Picking, and Quick Adds for the OR
10/29/2024 4:20 PM
Hi Everyone, I am wondering if there is any org
Lawson S3 HR/Payroll/Benefits
Canada Tax Calculation (Federal and Provincial) Issue
10/23/2024 5:00 AM
Initially, we had problem with CPP2 calculation is
Lawson S3 HR/Payroll/Benefits
CA Section 125 401k Plan
10/22/2024 10:13 PM
Does anyone have any recommendations on how to fac
S3 Systems Administration
Running AC120 deleted records from ACMASTER table
10/22/2024 3:40 PM
We recently ran the AC120 as normal and somehow it
Lawson S3 Procurement
RQ13 Approval Info
10/17/2024 2:12 PM
When a Requisition is approved on RQ13, what table
S3 Customization/Development
Read and Write CSV file COBOL
10/9/2024 2:53 PM
Does anyone have a quik example of a program that
Top Forum Posters
Name
Points
Greg Moeller
4184
David Williams
3349
JonA
3291
Kat V
2984
Woozy
1973
Jimmy Chiu
1883
Kwane McNeal
1437
Ragu Raghavan
1372
Roger French
1315
mark.cook
1244
Forums
Filtered Topics
Unanswered
Unresolved
Announcements
Active Topics
Most Liked
Most Replies
Search Forums
Search
Advanced Search
Topics
Posts
Prev
Next
Forums
Performance Management
Smart Notification
Display numeric as time
Please
login
to post a reply.
4 Replies
3
Subscribed to this topic
14 Subscribed to this forum
Sort:
Oldest First
Most Recent First
Author
Messages
thummel1
Veteran Member
Posts: 121
5/26/2015 4:53 PM
I am working on a smart note. There are 2 numeric columns designed to display in/out punches that will eventually come over in the Smart Note. One column has 'in' punches and the other has 'out' punches. When the table was designed, these columns were not formatted like hh:mm. They were formatted as numbers, no decimals. So the 'in' punch will look like 701 and the 'out' punch will look like 1150 (example).
Question: The end user wants to view these numbers like hh:mm. I am trying to think of creative ways to do that.
Idea 1: convert numeric to hh:mm, but everything I look up doesn't support this particular type of translation
Idea 2: formula to add a colon two digits to the left. I think thi swoudl work but just not sure how to construct the formula?
If you have any suggestions formulas you can direct me to that would be great. Thank you!
The.Sam.Groves
Veteran Member
Posts: 89
5/26/2015 6:18 PM
Assuming you are using Oracle SQL for the smart note:
to_char(to_date(to_char(your_timestamp, '0000'),'HH24MI'),'HH24:MI')
This converts the numeric to a four digit right zero padded string and then converts that back to a datetime value. It then reconverts the datetime back into a character string in 24 hour format with a : between the hour and the minutes.
I'm making assumptions that your SQL environment doesn't have a built in time only datatype (for instance Oracle has a timestamp datatype, however it is actually a datetime value with added precision on the seconds) if you did, you might be able to cut out the outer to_char and let SQL format the output on it's own.
But lacking that, if you attempted to run the above without manually specifying the format to use for the output, you'd get something more along the lines of '01-May-15' without any reference to a time.
thummel1
Veteran Member
Posts: 121
5/26/2015 7:06 PM
Thank you for your reply. I've inserted this formula into the statement. I've tried the following iterations:
TO_CHAR(to_date(TO_CHAR(ZZTMEDTTRN.IN_PUNCH, '0000'), 'HH24MI'), 'HH24:MI') -Error: ORA-01722: invalid number
TO_CHAR(to_date(TO_CHAR(.IN_PUNCH, '0000'), 'HH24MI'), 'HH24:MI') -Error: ORA-01722: invalid number
to_date(TO_CHAR(ZZTMEDTTRN.IN_PUNCH, '0000'), 'HH24MI'), 'HH24:MI') -Error: ORA-00932: inconsistent datatypes: expected NUMBER got DATE
Not sure where to go with these errors, any thoughts are welcome.
Another thought....If this is a numeric field as my table suggests, what about dividing by 100 and then replacing the decimal with a colon?
Again, not sure how to construct that, but it was another thought I had. I could do those things in Access or Crystal, but I'm not as versed in SQL Developer.
The.Sam.Groves
Veteran Member
Posts: 89
5/26/2015 8:08 PM
Unless that third version is missing text, your value doesn't seem to be the numeric you thought it was.
It may already be a datetime or it could be a character string already.
The first error, the only function that is expecting a number is the innermost TO_CHAR. And it's complaining that your timestamp isn't an number. The second is just a repeat. The third however is complaining that you are passing it a datetime when it wants a number. to_date doesn't want numbers, it wants dates. So the only thing that could be complaining there is to_char.
Try just
TO_CHAR(zztmedttrn.in_punch,'HH24:MI') - assuming it's a date
or
to_char(to_date(lpad(your_timestamp,4, '0'),'HH24MI'),'HH24:MI') - assuming it's text.
or alternatively, since you mention you have SQL Developer installed pull up the table and on the columns tab, what is the datatype the field is defined as?
thummel1
Veteran Member
Posts: 121
5/28/2015 11:32 AM
Hi All,
I was able to get a code that works. I am sharing it below:
to_char("ZZTMEDTTRN"."IN_PUNCH",'fm00G00','nls_numeric_characters=,:') as "IN_PUNCH",
The code above changes 1030 to 10:30 and 430 to 04:30.
Thank you to all who helped!
Please
login
to post a reply.