Date conversion warning
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 111
- Joined: Thu Jun 01, 2006 5:12 am
- Location: Detroit
Date conversion warning
Hi,
I am trying to ocnvert 6 digit value like 'yymmdd' value into actual date format like 'yyyy-mm-dd', I am able to do it by using below function but it's throowing below warning, Can anyone help me to stop that warning.
function : StringToDate(GLTxnread.NW_WRK_DT_SRC_ORIG,"%yy%mm%dd")
Warning: GLTxn_tfm_1,1: Conversion error calling conversion routine date_from_string data may have been lost
How to avoid this warning.
Thanks in advance.
I am trying to ocnvert 6 digit value like 'yymmdd' value into actual date format like 'yyyy-mm-dd', I am able to do it by using below function but it's throowing below warning, Can anyone help me to stop that warning.
function : StringToDate(GLTxnread.NW_WRK_DT_SRC_ORIG,"%yy%mm%dd")
Warning: GLTxn_tfm_1,1: Conversion error calling conversion routine date_from_string data may have been lost
How to avoid this warning.
Thanks in advance.
Re: Date conversion warning
hi,
using StringToDate(GLTxnread.NW_WRK_DT_SRC_ORIG,"2000%yy%mm%dd") works. But, the warning appears if the field has some invalid value. Example: "AA1253".
using StringToDate(GLTxnread.NW_WRK_DT_SRC_ORIG,"2000%yy%mm%dd") works. But, the warning appears if the field has some invalid value. Example: "AA1253".
Actually, it should be for dates in 2000 and the conversion without the century values uses the default system setttings.
If you have invalid non-date values, then you should add a call to the function IsValid() to determine whether or not you have a valid date before converting it.
Code: Select all
StringToDate(GLTxnread.NW_WRK_DT_SRC_ORIG,"20%yy%mm%dd")
If you have invalid non-date values, then you should add a call to the function IsValid() to determine whether or not you have a valid date before converting it.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
hi,ArndW wrote:Actually, it should befor dates in 2000 and the conversion without the century values uses the default system ...Code: Select all
StringToDate(GLTxnread.NW_WRK_DT_SRC_ORIG,"20%yy%mm%dd")
anybody khows how to avoid or treat the warning when the field has some invalid value using StringToDate?
The function isValid doesn't works because the input field are yymmdd and the default project value are yyyymmdd.
When I include StringToDate, it's works, but with warnings on the invalid field values.
thanks
-
- Premium Member
- Posts: 457
- Joined: Tue Sep 25, 2007 4:05 pm
Can't you just check whether the input string is numeric first and then pass it into the IsValid() function?f.hq wrote:hi,ArndW wrote:Actually, it should befor dates in 2000 and the conversion without the century values uses the default system ...Code: Select all
StringToDate(GLTxnread.NW_WRK_DT_SRC_ORIG,"20%yy%mm%dd")
anybody khows how to avoid or treat the warning when the field has some invalid value using StringToDate?
The function isValid doesn't works because the input field are yymmdd and the default project value are yyyymmdd.
When I include StringToDate, it's works, but with warnings on the invalid field values.
thanks
Code: Select all
stagevariable1 = Num(<Field>)
stagevariable2 = If stagevariable1 Then IsValid(...) Else <Reject>
Vivek Gadwal
Experience is what you get when you didn't get what you wanted
Experience is what you get when you didn't get what you wanted