Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21271

Help in update Query

$
0
0
sir,

I am having a table with such data

rocode tr_month tr_year ms hsd
123301 4 2011 10 110
123301 5 2011 40 140
123356 4 2011 45 145
123356 5 2011 107 207
123703 4 2011 32 132
123703 5 2011 50 150
123617 4 2011 10 110
123617 5 2011 65 165
123664 4 2011 35 135
123782 5 2011 80 180
123301 4 2012 10 110
123301 5 2012 40 140
123356 4 2012 45 145
123356 5 2012 107 207
123703 4 2012 32 132
123703 5 2012 50 150
123617 4 2012 10 110
123617 5 2012 65 165
123664 4 2012 35 135
123782 5 2012 80 180

on the above table I have to create a report for the report I have following table structure

id rocode tr_month tr_year ms hsd prev_ms prev_hsd cur_cm_ms cur_cm_hsd prev_cm_ms prev_cm_hsd
1 123301 5 2012 10 10 10 110 0 0 0 0
2 123340 5 2012 59 59 45 145 0 0 0 0
3 123356 5 2012 30 30 45 145 0 0 0 0

on the above structure prev_ms means (same month prev. year)
cur_cm_ms--- cur year ms total of tr_month no - 4 to the query month of year for the rocode--- for the financial year (financial year runs from April-4 to March -3)
cur_cm_hsd--- cur year hsd total of tr_month no - 4 to the query month of year


prev_cm_ms --Previous year ms total of tr_month no - 4 to the query month of previous year for the rocode --- for the financial year (financial year runs from April-4 to March -3)

I think the condition is clear.

I want to fire a query for the same. As I am able to update the earlier fields... Please guide and give some solution.

Thanks

Viewing all articles
Browse latest Browse all 21271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>