Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Bartender Query prompt

Posted on 2010-11-17
2
Medium Priority
?
4,580 Views
Last Modified: 2013-11-15
Does anyone know how to pass from Bartenders queryprompt into the sql script.
select g.posdesc,g.labl,retail1, b.siz from garment as g
join barcode as b on b.style= g.style
join pricing as p on p.style = b.style and p.pricepoint = b.pricepoint
where g.style = ?QueryPrompt1
The ?Queryprompt is the holder name in the query software bartender supplies for
getting input from the user.  If I pass the data directly ie g.style = '2313958'  no problem.
The error message I get from the SQL is "Conversion failed when converting the varchar
value '.' to data type int
0
Comment
Question by:CamBal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
Nathan Riley earned 2000 total points
ID: 34161533
Sounds like your passing invalid data then is ?queryprompt a variable?  Could it be passing data other than numbers?  That what it sounds like is happening.  Try the query below, that may work, otherwise you need to check your data that's being passed, there are text values within it.

select g.posdesc,g.labl,retail1, b.siz from garment as g
join barcode as b on b.style= g.style
join pricing as p on p.style = b.style and p.pricepoint = b.pricepoint
where cast(g.style as int) = cast(?QueryPrompt1 as int)
0
 

Author Comment

by:CamBal
ID: 34167076
Thanks.  You put me onto the right process.  the style is actually a varchar so I used "where g.style = cast(?QueryPrompt1 as varchar) and all works.  Much appreciated. :-)
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Here in this article, you will get a step by step guidance on how to restore an Exchange database to a recovery database. Get a brief on Recovery Database and how it can be used to restore Exchange database in this section!
This video will demonstrate how to find the puppet warp tool from the edit menu and where to put the points to edit.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question