Using a variable with sql

  • Thread starter Thread starter Jay Easley
  • Start date Start date
J

Jay Easley

I'm trying to refrence a value in a variable for the name
of the column and I'm having some trouble. here's what i
got so far. I wnat to be able to change the July '04 to
the value in the variable, but I can't seem to get it to
agree. Any help would be appreciated.

Reports!bMP_Report_02_Task_Force_Bar_Chart!
Graph2.RowSource = "SELECT Manpower_Query.Location,Format
(Sum([Month_1])/173.2,'0.0') AS [July '04] , Format(Sum
([Month_2])/173.2,'0.0') AS [AUG '03]

Thanks,
jay
 
Hi,
Try something like this:
Graph2.RowSource = "SELECT Manpower_Query.Location," & _
"Format (Sum([Month_1])/173.2,'0.0') AS " & yourVariable & _
" , Format(Sum([Month_2])/173.2,'0.0') AS [AUG '03]"


--
HTH
Dan Artuso, Access MVP


Jay Easley said:
I'm trying to refrence a value in a variable for the name
of the column and I'm having some trouble. here's what i
got so far. I wnat to be able to change the July '04 to
the value in the variable, but I can't seem to get it to
agree. Any help would be appreciated.

Reports!bMP_Report_02_Task_Force_Bar_Chart!
Graph2.RowSource = "SELECT Manpower_Query.Location,Format
(Sum([Month_1])/173.2,'0.0') AS [July '04] , Format(Sum
([Month_2])/173.2,'0.0') AS [AUG '03]

Thanks,
jay
 
Back
Top