WHERE (((Supply_Table.Show) Like Yes))
is incorrect
If Show is a boolean field (Yes/No), that should be:
WHERE (((Supply_Table.Show) = True))
If Show is a text field with Yes as a value in it, use
WHERE (((Supply_Table.Show) = "Yes"))
If Show is a text field and you want all rows where Show starts with the
word Yes, use
WHERE (((Supply_Table.Show) Like "Yes*"))
If Show is a text field and you want all rows where Show contains the word
Yes anywhere in the string, use
WHERE (((Supply_Table.Show) Like "*Yes*"))
If you're using ADO to run the query, rather than Access's normal DAO,
replace * with % in the last two examples.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
ktfrubel said:
Here you go Chris
SELECT Supply_Table.*,
IIf([physical_count]<=[ReOrder_level],[qty_to_maintain]-[physical_count]) AS
Qty_to_Order
FROM Supply_Table
WHERE (((Supply_Table.Show) Like Yes))
ORDER BY Supply_Table.Product_Description;
ChrisM said:
If you can,
In the query design screen, select the SQL view, and post the SQL from the
query here
Cheers,
Chris.
I have checked and double checked... I even created a whole new query. I
just don't know.....It should work, but it isn't///
:
Hmm,
What you had in your OP (or at least my correction to it) seems perfectly
fine to me.
Double check your spelling, and make sure the field names in the
calculated
field are EXACTLY the same as the astual field names (check
underscores/spaces and everything). If its prompting you for 'reorder
level'
then I'm guessing that's most likely the one that is different?
I notice in your post, you refer to 'Reorder Level' but in your original
post, your field is 'Reorder_qty'...?
Cheers,
Chris.
Chris,
I apologize for being so vauge.
The Qty_to_order field is a caluclated field in the query. Right now
it
is
written simply as Qty_to_Order: [maintain_qty]-[Physical_Count]. This
gives
me what I want. However thinking of exactly what I needthis query to
do,
I
discovered that I need to add a new field which is the ReOrder Level
Field.
I added the field to my main table. So I thought I would write the
code
that
I listed below becuase I would like the Qty_to_order field to populate
the
difference between the Maintaining filed and the Physical field only if
the
physical count is less than or equal to the reorder level.
Now when I run the query...I get asked a "parameter" question
pertaining
to
the reorder level, and none of the calculation work any more.
Confused?????
Me too!
:
I am stumped!
I have 3 fields.
Reorder_qty
Maintain_qty
Physical_Count
This is what I have written so far.
Qty_to_order:
IIf([physical_Count]<=[Reorder_qty],[maintain_qty]-[Physical_Count].
I basically want the query to give me a total of how much to order
when
the
Physical count is less than or equal to the reorder level. But it
needs
to
generate the difference between the maintain qty and the physical
count.
What am I doing wrong?
You don't actually say what the problem is, maybe you could give a few
more
details.
In the meantime, may I just correct what I assume is a typo in your
code,
if
it isn't then that may be your problem:
IIf([physical_Count]<=[Reorder_qty],[maintain_qty]-[Physical_Count],0)
Cheers,
Chris.