unfortunately am getting error messages with formula (by the way database is Sybase). Below is formula in its entireity. Error messages are Incorrect syntax on lines 31, 36, 42, 48, 54, 61, and 67. Any help appreciated.
31 If datepart(Month,getdate()) between 1 and 3
32 Begin
33 Select "Post_Date"
34 From Transaction_History
35 Where datepart(month, "Post_Date"

between 10 and 12
36 Else if
37 datepart(Month,getdate()) between 4 and 6
38 Begin
39 Select "Post_Date"
40 From Transaction_History
41 Where datepart(month, "Post_Date"

between 1 and 2
42 Else if
43 datepart(Month,getdate()) between 7 and 9
44 Begin
45 Select "Post_Date"
46 From Transaction_History
47 Where datepart(month, "Post_Date"

between 4 and 6
48 else if
49 datepart(Month,getdate()) between 10 and 12
50 Begin
51 Select "Post_Date"
52 From Transaction_History
53 Where datepart(month, "Post_Date"

between 7 and 9
54 and if
55 datepart(Month,getdate()) between 1 and 3
56 Begin
57 Select "Post_Date"
58 From Transaction_History
59 Where datepart(year, "Post_Date"

= datepart
60 (year,getdate(-1))
61 Else
62 Begin
63 Select "Post_Date"
64 From Transaction_History
65 Where datepart(year, "Post_Date"

= datepart
66 (year,getdate())
67 END