on 09-10-2008 12:32 PM
Hi,
I want to convert the string field to data format.I tried the option cdate(table.field)
but once again it is throwing an error saying"Formula must be string"
so i gave cstr(cdate(table.field)) but i am getting the value as 4/5/2008
but in the db it is 04/05/2008
Any suggestions
Regards,
Rajasekar
Hi,
You want to convert string value to date value.
You are using cdate function here which would do the job however cstr function again converts it into a text.
Would suggest you to modify the formula like this
if isdate(databasefield) then cdate(database field)
here isdate function will check weather the database field value can be converted to a date value.
Place this formula on report and right click it and click on Format Field.
Under the Date tab select the format as 03/01/1999.
Click OK and it will show the required results and the value returned will be a date value as well.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajasekar,
Try to create a formula like :
Numbervar dd;
Numbervar mm;
Numbervar yy;
dd:=tonumber(left({Sheet1_.dt},2));
mm:=tonumber(mid({Sheet1_.dt},4,2));
yy:=tonumber(right({Sheet1_.dt},4));
datevalue(yy,mm,dd);
Once you get the value in your report use format option and apply the format '02/12/2008'
Hope this will resolve the issue.
Regards,
Sastry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried this but i am getting an error saying the "formula must be string"
Also tried to create two formula
@F1=Tbl.field
@F2=Cdate(@@F1)
Now i am getting the data format as 01/01/2008,but i have a requirement to change this date based on the user preferences from main report.
I have a variable in main report which stores the user preferences,i need to use that variable and have to change the sub report date format.
The user may give the date format as 12 Sep 2008 i need to get my subreport date also based on this but i am getting 2008/9/12
Any suggestions
Regards,
Rajasekar
User | Count |
---|---|
86 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.