Hi, is it possible to use pre-existing formulas and parameters in an sql expression. For example, I want to use a data field and a crystal report parameter in a sql expression to sum a calculated field. I have tried to make a sql expression such as:

SELECT SUM([Total Minutes]) / 15
FROM ClientTimes 
WHERE ClientID = (select ClientID from ClientNames where [Full Name] = {ClientName})
AND DATEADD(dd, 0, DATEDIFF(dd, 0, TimeIn)) = {fn Convert(DateTime,{Day0}}
Where: ClientName is a formula and Day0 is a parameter.

Very new to this and would greatly appreciate any info on how to do this.
Thank you.