By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,455 Members | 2,157 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,455 IT Pros & Developers. It's quick & easy.

Problem with inputing criteria for query?

P: 2
I'm making a query so user can look for orders which are completed or not
Expand|Select|Wrap|Line Numbers
  1. SELECT Orders.Order_ID, Orders.Order_date, Orders.Order_complete
  2. FROM Orders
  3. WHERE (((Orders.Order_complete)=[Please enter]));
My problem is I cannot type in "Yes" or "No" when I was asked to input the value. Is there any way possible to fix this because the query works fine if I change it to this.
Expand|Select|Wrap|Line Numbers
  1. SELECT Orders.Order_ID, Orders.Order_date, Orders.Order_complete
  2. FROM Orders
  3. WHERE (((Orders.Order_complete)=Yes));
Thanks
Oct 30 '08 #1
Share this Question
Share on Google+
4 Replies


DonRayner
Expert 100+
P: 489
I'm assuming that your Yes or no is going into a yes/no (bit) type field. If so your query would need to have this added at the beginning

PARAMETERS [Please enter] Bit, so your sql code would look like this

Expand|Select|Wrap|Line Numbers
  1. PARAMETERS [Please enter] Bit;
  2. SELECT Orders.Order_ID, Orders.Order_date, Orders.Order_complete
  3. FROM Orders
  4. WHERE (((Orders.Order_complete)=[Please enter]));
  5.  
Oct 30 '08 #2

NeoPa
Expert Mod 15k+
P: 31,186
It seems you're confusing Yes with "Yes".

Yes is a boolean value representing True (numerically -1), whereas "Yes" is a string value representing (You got it - "Yes").
Oct 30 '08 #3

P: 2
Thanks for all the reply guys, my problem was solved.
Oct 31 '08 #4

NeoPa
Expert Mod 15k+
P: 31,186
Very pleased to hear that :)

Welcome to Bytes!
Oct 31 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.