Hi, here is my statement. it give me an error saying that I am missing a "" on the first line on the 1
Thanks, Jae.
if ({?DateRange}(1) = Date(1900,1,1)) then
(IsNull ({Orders.Voided}) or {Orders.Voided}<>1) and
{Orders.restid} in {?RestID} and
{Orders.orderdate} = DateAdd ("d", -1, CurrentDate)
else if ({?DateRange}(1) = Date(1900,1,2)) then
((IsNull ({Orders.Voided}) or {Orders.Voided}<>1) and
{Orders.restid} in {?RestID} and
{Orders.orderdate} = WeekToDateFromSun
else if ({?DateRange}(1) = Date(1900,1,3)) then
((IsNull ({Orders.Voided}) or {Orders.Voided}<>1) and
{Orders.restid} in {?RestID} and
{Orders.orderdate} = Last7Days
else if ({?DateRange}(1) = Date(1900,1,10)) then
((IsNull ({Orders.Voided}) or {Orders.Voided}<>1) and
{Orders.restid} in {?RestID} and
{Orders.orderdate} = MonthToDate
else if ({?DateRange}(1) = Date(1900,1,15)) then
((IsNull ({Orders.Voided}) or {Orders.Voided}<>1) and
{Orders.restid} in {?RestID} and
{Orders.orderdate} = CurrentDate
else if ({?DateRange}(1) = Date(1900,1,20)) then
((IsNull ({Orders.Voided}) or {Orders.Voided}<>1) and
{Orders.restid} in {?RestID} and
{Orders.orderdate} = YearToDate
else
((IsNull ({Orders.Voided}) or {Orders.Voided}<>1) and
{Orders.restid} in {?RestID} and
{Orders.orderdate} in {?DateRange}
The problem is that you need square brackets to substring a multiple value parameter. Try:
if ({?DateRange} [1] =
Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Tips and Tricks / Guide to Crystal in VB
I don't think you can use parens in a Crystal Substring. You are sure that was in CR?
Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Tips and Tricks / Guide to Crystal in VB
That is because you are using 'Basic' syntax, not Crystal syntax, in your formula field. The selection formula has to be in Crystal syntax.
Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Tips and Tricks / Guide to Crystal in VB
ok i changed my selection formula to the following but when I select Database | Show SQL Query, it does not reflect my formula. My formula saved ok...does this mean that my SQL Server doesn't like the formula ??
(IsNull ({Orders.Voided}) or {Orders.Voided}<>1) and
{Orders.restid} in {?RestID} and
(
if myDate = Date(1900,1,1) then
{Orders.orderdate} = CurrentDate
else if myDate = Date(1900,1,2) then
{Orders.orderdate} = DateAdd ("d", -1, CurrentDate)
else if myDate = Date(1900,1,3) then
{Orders.orderdate} = WeekToDateFromSun
else if myDate = Date(1900,1,10) then
{Orders.orderdate} = Last7Days
else if myDate = Date(1900,1,15) then
{Orders.orderdate} = MonthToDate
else if myDate = Date(1900,1,20) then
if Month(CurrentDate) in [1,2,3] then
{Orders.orderdate} = Calendar1stQtr
else if Month(CurrentDate) in [4,5,6] then
{Orders.orderdate} = Calendar2ndQtr
else if Month(CurrentDate) in [7,8,9] then
{Orders.orderdate} = Calendar3rdQtr
else
{Orders.orderdate} = Calendar4thQtr
else if myDate = Date(1900,1,25) then
{Orders.orderdate} = YearToDate
else
{Orders.orderdate} in {?DateRange}
)
Many Crystal functions can't be converted to SQL, which forces the processing to be local. All of your Date functions, DATE, YEAR, MONTH, etc. have to be processsed locally.
Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Tips and Tricks / Guide to Crystal in VB
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.