Hi!
My imput in Transformer is '20060413', this is a date in the format(YYYYMMDD). But in some cases I receive '00000001' that is a invalid date.
Well, I would like to make a server routine that when receive the imput check if is a valid or invalid date.
Regards,
Fernando Martins
Fuction
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 142
- Joined: Wed Mar 24, 2004 10:51 am
- Location: Brazil
Consider writing a date validation function with range checking, or use a TIME dimension table and validate every date.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Participant
- Posts: 142
- Joined: Wed Mar 24, 2004 10:51 am
- Location: Brazil
Thank you every body, but I preferred to make a server routine.
It is in a version 1.0 but work in some cases.
Follow the code.
DD=Data[8, 2]
MM=Data[6, 2]
AA=Data[2, 4]
RETORNO=Data[1, 9]
If (DD > 0 AND DD < 32) AND (MM > 0 AND MM < 13) AND AA > 1 Then RETORNO=RETORNO
Else RETORNO="000010101"
Ans=RETORNO
Best Regards,
Fernando Martins
It is in a version 1.0 but work in some cases.
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
Follow the code.
DD=Data[8, 2]
MM=Data[6, 2]
AA=Data[2, 4]
RETORNO=Data[1, 9]
If (DD > 0 AND DD < 32) AND (MM > 0 AND MM < 13) AND AA > 1 Then RETORNO=RETORNO
Else RETORNO="000010101"
Ans=RETORNO
Best Regards,
Fernando Martins
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 142
- Joined: Wed Mar 24, 2004 10:51 am
- Location: Brazil
Fuction
Sorry
,
I'm working with 8 character.
Regards,
Fernando
![Embarassed :oops:](./images/smilies/icon_redface.gif)
I'm working with 8 character.
Regards,
Fernando
ray.wurlod wrote:Are you really working with a nine character string here? If you are using a five digit year, then the substring extractions will need to be changed. ...