SQL statement

amypaulsen

Board Regular
Joined
Mar 1, 2004
Messages
114
Below is the sql statement that I am using within my code. I am using a SQL statement to select certain criteria out of Access. I keep getting a compile error message right after "TOTAL" that says Expected: end of statement. I tried putting in an underscore to account for the spaces and then the error comes after the ":", right on the underscore (right before 7110-4499) saying "invalid character". Please bear with me as access really isn't my thing!

strSQL = "SELECT qryFlash05.UNIT, qryFlash05.category, qryFlash05.[" & WeekNum & "] from [qryFlash05] where category = '" & TOTAL CONTROLLABLE COST : 7110.4499 & "';"

Thanks!!! :)
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Does this work?

strSQL = "SELECT qryFlash05.UNIT, qryFlash05.category, qryFlash05.[" & WeekNum & "] from [qryFlash05] where category = 'TOTAL CONTROLLABLE COST : 7110.4499';"
 
Upvote 0

Forum statistics

Threads
1,221,808
Messages
6,162,097
Members
451,742
Latest member
JuanMark10

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top