HasanaMonique 0 Newbie Poster

Hi,

I am VERY new to SQL and I do not know if I am word this question correctly, so forgive me.

I would like to create a new table that does calculations on some of the same fields.
• IPA number (from the IPA_Num field)
• Total number of Rx's (sum of rx field )
• Total Paid( sum of amt_paid field)
• Total generic paid (If the field drugs = 1 then sum the amt_paid field)
• Percent generic (If the field drugs = 1 then sum and divide by the sum of the field rx)
• Percent formulary (if the formulary field = A then sum and divide by the rx field)
• Cost difference ( Average amount paid per brand Rx - average amount paid per generic Rx )

Any help is greatly appreciated.

Blessing to all

Yvonne
:eek:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.