Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
cardgunner
326 Posts |
Posted - 2007-06-25 : 09:58:25
|
| I'm used to MS Access where as putting "[" s around a question would then prompt that question when you ran the query. You would type in the answer and that answer was then then part of the criteria for your query.I looked on bol and they said that i could just use a "?" or use "%" to surround the question. That doesn't work. I get [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax errorWhat am I doing wrong?Card Gunner |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-06-25 : 10:01:39
|
| show us your query._______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-06-25 : 10:04:46
|
| Post your question at Access ForumMadhivananFailing to plan is Planning to fail |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-06-25 : 10:05:49
|
| If you are using ? in QA to get the same interactivity you get in MS-Access, be clear that QA does not have that kind of facility for SQL Server. You can set the parameter values manually and run the script.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
cardgunner
326 Posts |
Posted - 2007-06-25 : 10:36:49
|
| Spiritselect BUYID, BPID, BUYCOMP1, BUYADR1FROM QRY9962WHERE BUYID=?madhivananI don't need to post it on MS Access cause I know it works there. I can do it in Access. I don't know how to do it in SQLHarshQA does not have the type of interactivity? So if I have a an update that I need to do over and over with different ID's I need to go into the script and change it. That is not a big deal it is just cleaner when there is a prompt for an answer. Like I said if it's not available in QA - OK, not a problem- I'm moving on.Thank you all very much. I hope I'm not abusing this forum. I find it very helpful. I do try to find my answer out there before I post.Again thank you.Card Gunner |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-06-25 : 10:57:45
|
| you have to do this with a parameter:declare @BUYID int -- it must be the same datatype as your columnselect @BUYID = 5 -- set the value to somethingselect BUYID, BPID,BUYCOMP1,BUYADR1FROM QRY9962WHERE BUYID = @BUYID_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-06-26 : 01:13:15
|
| <<I don't need to post it on MS Access cause I know it works there. I can do it in Access. I don't know how to do it in SQL>>SQL Server wont prompt you to enter valuesMake use of parameters as suggestedMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|