Joined: 12 Dec 2007
Location: United States
Online Status: Offline
Posts: 8
Topic: If and then, else statments Posted: 20 Dec 2007 at 7:19am
Can anyone instruct me as to develop a if, then, else statement for a facility that I inspect that would give the following, If {View_tblInspections.InspectionDate}= Month({View_tblInspections.InspectionDate}) in 10 to 12 and year ({View_tblInspections.InspectionDate}) = 2007 then insert that date {View_tblInspections.InspectionDate} else insert nodate
I need the order for the statement to work. any ideas?? Ron
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Posted: 20 Dec 2007 at 11:35am
Off the top of my head (you need to test/tweak it...)
if (Month({View_tblInspections.InspectionDate}) IN 10 TO 12) AND (Year{View_tblInspections.InspectionDate}) = 2007 Then CStr({View_tblInspections.InspectionDate}) Else ""
If you want to learn more about writing formulas and programming with Crystal syntax, I have three chapters dedicated to it in my book Crystal Reports Encyclopedia
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum