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
Solved

Bartender Query prompt

Posted on 2010-11-17
2
4,206 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
2 Comments
 
LVL 11

Accepted Solution

by:
N R earned 500 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Free HD cloner 11 84
sql help 2 45
SQL Server: Unable to remove duplicate sets in Header/Detail 6 27
Looking for good Imaging Software 6 28
I previously wrote an article addressing the use of UBCD4WIN and SARDU. All are great, but I have always been an advocate of SARDU. Recently it was suggested that I go back and take a look at Easy2Boot in comparison.
A list of useful business intelligence software.
The viewer will learn how to set up a document for the web and print and the recommended PPI for printing.
The viewer will learn common shortcuts with easy ways to remember them. The viewer will then learn where to find all of the keyboard shortcuts, how to create/change them, and how to speed up their workflow.

809 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