Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Need help calculating number of days worked Post Reply Post New Topic
Author Message
RTSFO
Newbie
Newbie
Avatar

Joined: 10 Sep 2009
Online Status: Offline
Posts: 36
Quote RTSFO Replybullet Topic: Need help calculating number of days worked
    Posted: 10 Sep 2009 at 1:37pm

Hi,

I have 7 columns in the database for seven days of the week with a Y or N value.

I want to calculate the number of days worked based on the value Y.

Can some one help?

Thanks in advance.

IP IP Logged
BernieHunt
Newbie
Newbie


Joined: 03 Apr 2007
Location: United States
Online Status: Offline
Posts: 21
Quote BernieHunt Replybullet Posted: 17 Sep 2009 at 12:29pm

How about step through each field and increment a counter if it contains a Y?

dim i as integer
dim daysWorked as integer = 0
 
For i = 0 to 7
   if myRow(i).compareto("Y") = 0 then daysWorked += 1
Next
 
Would something like this work for you?
 
Bernie
IP IP Logged
RTSFO
Newbie
Newbie
Avatar

Joined: 10 Sep 2009
Online Status: Offline
Posts: 36
Quote RTSFO Replybullet Posted: 18 Sep 2009 at 10:15am
Thank you for your suggestion. I added the summing up formula to the sql and pulling the field from sql.
Thanks
 
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.016 seconds.