CrystalVis
Technical User
i have a result table that stores the data for my report and a calendar table that stores weekend and holiday.
the result table has the following attributes:
account_id
account_status
status_creation_datetime
what I need to do is select all attributes from the result table. However, I have to perform a calculation of the status_creation_datetime against the system date excluding weekend and holiday from the calendar table to figure out the number of business days that an account is in a particular status.
for example:
SELECT
account_id,
account_status,
datediff(status_creation_datetime,getdate()) - (count(*) of weekend and holiday from calendar where nonworkdays is between status_creation_datetime and getdate())
i know this is a psudocode but i'm not sure how to accomplish this for all records in my result table. Any help/suggestion you can provide is greatly appreciated.
Thanks
the result table has the following attributes:
account_id
account_status
status_creation_datetime
what I need to do is select all attributes from the result table. However, I have to perform a calculation of the status_creation_datetime against the system date excluding weekend and holiday from the calendar table to figure out the number of business days that an account is in a particular status.
for example:
SELECT
account_id,
account_status,
datediff(status_creation_datetime,getdate()) - (count(*) of weekend and holiday from calendar where nonworkdays is between status_creation_datetime and getdate())
i know this is a psudocode but i'm not sure how to accomplish this for all records in my result table. Any help/suggestion you can provide is greatly appreciated.
Thanks