Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assistance with Convert Function 1

Status
Not open for further replies.

Sydney1

Technical User
Jul 14, 2004
156
US
Hi,

I'm trying to change the following Access query field
Code:
Assessed: Sum(IIf([FeeType]="A",[FeeTotal],0))
to a field in a SQl View. So far, I have the following
Code:
sum(case Convert(money,[feeType]) when 'A' Then [FeeTotal] Else '0') End As Assessed

but am getting an error by the ' and am not sure if I have the converting down correctly. [feetype] is a char field and [feeTotal] is a money.

thanks so much for your help.

Sydney
 
Hi,

That did it. Thanks so much. I've got one more field that's giving me trouble In Access it is
Code:
TFee: IIf([Paid]=0 And [Assessed]>0,[Assessed]+[Waived],IIf([Assessed]+[Paid]<0,0,IIf([Paid]<0 And [Assessed]>0,[Assessed]+[Paid]+[Waived],0)))
And So far I have

Code:
Case([Paid] When 0 and [assessed] >0 Then [assessed]+[Waived] when [assessed]+[Waived]<0 Then 0 When [Paid]<0 and [Assessed]>0 then [Assessed]+[Paid]+[Waived] else 0 End) as TFee
and am getting an error at When

Thanks again,

Sydney
 
Hi,


It appears that SQL doesn't like the column names without the brackets, as when I add it to the same view that names assessed, waived and paid, I get errors for each time assessed, paid, and waived are in the tfee statement.

Thanks again for all your help

Sydney
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top