Solved

Bartender Query prompt

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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.
In our personal lives, we have well-designed consumer apps to delight us and make even the most complex transactions simple. Many enterprise applications, however, are a bit behind the times. For an enterprise app to be successful in today's tech wo…
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now