Date conversion
Moderators: chulett, rschirm, roy
Date conversion
Hi All,
Please help how to convert string to date in PX
Ex. 20061122 to 11/22/2006
thanks in advance
Please help how to convert string to date in PX
Ex. 20061122 to 11/22/2006
thanks in advance
SHYAM
Oddly enough, the StringToDate function.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
That hits the bull's eyechulett wrote:Oddly enough, the StringToDate function.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 224
- Joined: Tue Sep 24, 2002 7:32 am
- Location: Denver, CO USA
John - this is a PX subject - so the typical server conversions won't work and you should explicitly convert datatypes and this is what Ray has pointed out.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Premium Member
- Posts: 224
- Joined: Tue Sep 24, 2002 7:32 am
- Location: Denver, CO USA
You might have to explain this further - I understand this is a PX topic. This is what I am doing in a derivation:
ValidDateOpen is a VarChar stage variable that verifies that the date is valid. The derivation is in a Timestamp field. Maybe the underlying data type is string as Ray points out, but the Oracle Enterprise stage eventually gets it to a date.
It may be this isn't the best way to do it, but it is working. Could it be a version issue? I'm on 7.5.1.A Enterprise Edition.
John
Code: Select all
IF ValidDateOpen = '0' THEN SetNull() ELSE ValidDateOpen[1,4] : '-' : ValidDateOpen[5,2] : '-' : ValidDateOpen[7,2] : ' 00:00:00'
It may be this isn't the best way to do it, but it is working. Could it be a version issue? I'm on 7.5.1.A Enterprise Edition.
John