Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: how to do use mid function? Post Reply Post New Topic
Author Message
swallow.pa
Newbie
Newbie


Joined: 26 Apr 2012
Online Status: Offline
Posts: 26
Quote swallow.pa Replybullet Topic: how to do use mid function?
     Posted: 03 May 2012 at 9:48pm
hi dears
i want to  use mid function in my report
Mid({VocherPrint.YearsRef},1,4)
but i see this error

A string is required here
please help me
thank
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 04 May 2012 at 4:08am
If your VocherPrint.YearsRef is a number or date datatype  you will get this error. Make sure you convert it to a string. You can use:
CStr{VocherPrint.YearsRef}) or
ToText({VocherPrint.YearsRef}) in your Mid function
 
Hope this helps
 
Regards
 
John W.
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 04 May 2012 at 5:59am
I am guessing that YearsRef is either  a date or a number, Mid only works on strings...so as John gave, you need to convert your number/date to a string.
 
just for future reference
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum