We help IT Professionals succeed at work.

Crystal Reports - Get DayOfWeek ID from Startdate and EndDate parameters

Jasmin01
Jasmin01 asked
on
706 Views
Last Modified: 2012-02-13
Hi.

I have a Crystal Report that accepts a start dat and an end date as parameters.  If the user enters a date range of 01/11/2011 - 14/11/2011, I need a field that will give me the dayofweekID for each of the days.  
For eg, I need a field that will display:

DayofWeekID
      Tuesday
      Wednesday
      Thursday
      Friday
      Saturday    etc.....

I am basically looking for work done on Mondays, Tuesdays, Wednesdays, etc, for the time period entered as a parameter.

Can anyone help?
Comment
Watch Question

Commented:
this is function return string

 public string GetTodayMiladiDate()
        {
            string todaydate = string.Empty;
            System.Globalization.UmAlQuraCalendar hc = new System.Globalization.UmAlQuraCalendar();
            string day = hc.GetDayOfWeek(DateTime.Now).ToString().ToLower().Trim();
            switch (day)
            {
                case "friday":
                    day = "¿¿¿¿¿¿";
                    break; // TODO: might not be correct. Was : Exit Select

                  
                case "saturday":
                    day = "¿¿¿¿¿";
                    break; // TODO: might not be correct. Was : Exit Select

          
                case "sunday":
                    day = "¿¿¿¿¿";
                    break; // TODO: might not be correct. Was : Exit Select

             
                case "monday":
                    day = "¿¿¿¿¿¿¿";
                    break; // TODO: might not be correct. Was : Exit Select

             
                case "tuesday":
                    day = "¿¿¿¿¿¿¿¿";
                    break; // TODO: might not be correct. Was : Exit Select

           
                case "wednesday":
                    
                    day = "¿¿¿¿¿¿¿¿";
                    
                    break; // TODO: might not be correct. Was : Exit Select

          
                case "thursday":
                    day = "¿¿¿¿¿¿";
                    break; // TODO: might not be correct. Was : Exit Select

            
            }
            
            return day;
        }

Open in new window

CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Commented:
under view click field explorer
that will usually open up to the right side

then you will see formula fields
open the +
right click selecy new
it will ask you to enter a nams
add a name click ok
then where the cursor is enter the formal
drap drop formula to the report
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks guys
CERTIFIED EXPERT

Commented:
You're welcome.  Glad I could help.

 James
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.