Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Verify Format of Text field "*****-****-***" Post Reply Post New Topic
Author Message
chudok
Groupie
Groupie


Joined: 18 May 2010
Online Status: Offline
Posts: 70
Quote chudok Replybullet Topic: Verify Format of Text field "*****-****-***"
     Posted: 15 Apr 2013 at 4:51am
I have a text field that is not always filled out properly.  I cannot force users to do this, but I need to run a report to find fields with mistakes.

Example - the field has 5 characters, a dash, 4 characters, a dash, 3 characters

*****-****-***

How can I make sure it is like this?

I think I can use "len" and possible "mid"
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Apr 2013 at 6:07am
this will not care what the 'character' values are in the '*' values but it will check the total length and location of the dashes
 
NOT(len({table.field})=14
and
mid({table.field},6,1)="-"
and
mid({table.field},11,1)="-")
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