cancel
Showing results for 
Search instead for 
Did you mean: 

Add dates and timings in crystal reports

Former Member
0 Kudos

I would like to run the report, those who work fulltime  on weekdays.

For example:

Conditions to write a filter# if the table.Status= active (still working online) from the Friday on/before 7pm (table.start date) to Sunday 4pm on/after (table.end date) then I have to display his records

Condition#If the user start at Friday after 7pm and logsoff before Sunday 4pm then I need to eliminate his records

Note: IF the user starts working from Friday (startdate with variable timings) definitely the user will quit sometime around either Saturday or Sunday late night

I am using the, Table.Status, Table.startdate and Table.end date fields.

  1. In the report- selection formulas-record. I need to create a filter to eliminate weekend record users those who work work for only small time on weekends

Accepted Solutions (1)

Accepted Solutions (1)

JWiseman
Active Contributor
0 Kudos

hi phani thota,

you can use something like

    dayofweek({startdate}) = 6

    and time({startdate}) <= time('19:00')

    and dayofweek({enddate}) = 0

    and time({enddate}) >= time('16:00')

please note though that if your database is large then you may suffer some performance issues using this type of syntax in your record selection. this is because these 4 lines will not be processed at the database...instead all records will return to your report and then be processed in crystal which is not recommended for large data sets.

if there is a performance issue, i would recommend creating a new report using a Command object and then writing out the syntax in sql specific for your database instead. i.e. find your database functions for dayofweek and time and then rewriting the WHERE clause (the above filter) based on those functions.

cheers,

jamie

Former Member
0 Kudos

thanks it works

Answers (0)