Report Design
 Crystal Reports Forum : Crystal Reports .NET 2003 : Report Design
Message Icon Topic: Adding : to a string (every 2 characters) Post Reply Post New Topic
Author Message
andrew
Newbie
Newbie
Avatar

Joined: 11 Nov 2008
Location: United Kingdom
Online Status: Offline
Posts: 35
Quote andrew Replybullet Topic: Adding : to a string (every 2 characters)
    Posted: 03 May 2011 at 5:21am
Hi all,

I'm working on a report to catalog tapes coming into a TV station.

The timecodes are stored in the database as a string (00000000)

For the operators to read it properly, I need to add : in every 2 characters so it splits the string as:

00:00:00:00 (Hours, Minutes, Seconds, Frames).

Is there  a pre-existing function that can do this, or is the best way to create an array and then create a new string that adds the array together along with..

& ":" & ?

Many thanks!

Andrew


Edited by andrew - 03 May 2011 at 5:21am
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 03 May 2011 at 10:43am
Try this (Crystal syntax):
 
Left({table.field}, 2) + ':' + mid({table.field}, 3, 2) + ':' + mid({table.field}, 5, 2) + ':' + right({table.field}, 2)
 
-Dell
IP IP Logged
andrew
Newbie
Newbie
Avatar

Joined: 11 Nov 2008
Location: United Kingdom
Online Status: Offline
Posts: 35
Quote andrew Replybullet Posted: 04 May 2011 at 10:41pm
Hi Hilfy - thank you so much, that code works great!
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.