What am I doing wrong?

  • Thread starter Thread starter Ayo
  • Start date Start date
A

Ayo

I know something is wrong with this select statement, but I don't know what
it is. Please help. Thank you.

Select [Inscope Table].[Date Aproved by GM PM for Invoicing],[Inscope
Table].[AT&T Extended Price] from [Inscope Table] where [Inscope Table].[Date
Aproved by GM PM for Invoicing]<>"" and [AT&T Extended Price]<>0
 
Try

SELECT [Inscope Table].[Date Aproved by GM PM for Invoicing], [Inscope
Table].[AT&T Extended Price]
FROM [Inscope Table]
WHERE ((Not ([Inscope Table].[Date Aproved by GM PM for Invoicing]) Is Null)
AND (([Inscope Table].[AT&T Extended Price])<>0));

Or

SELECT [Inscope Table].[Date Aproved by GM PM for Invoicing], [Inscope
Table].[AT&T Extended Price]
FROM [Inscope Table]
WHERE ((([Inscope Table].[Date Aproved by GM PM for Invoicing]) Not Like "")
AND (([Inscope Table].[AT&T Extended Price])<>0));
 
Thanks Wayne

Wayne-I-M said:
Try

SELECT [Inscope Table].[Date Aproved by GM PM for Invoicing], [Inscope
Table].[AT&T Extended Price]
FROM [Inscope Table]
WHERE ((Not ([Inscope Table].[Date Aproved by GM PM for Invoicing]) Is Null)
AND (([Inscope Table].[AT&T Extended Price])<>0));

Or

SELECT [Inscope Table].[Date Aproved by GM PM for Invoicing], [Inscope
Table].[AT&T Extended Price]
FROM [Inscope Table]
WHERE ((([Inscope Table].[Date Aproved by GM PM for Invoicing]) Not Like "")
AND (([Inscope Table].[AT&T Extended Price])<>0));

--
Wayne
Manchester, England.



Ayo said:
I know something is wrong with this select statement, but I don't know what
it is. Please help. Thank you.

Select [Inscope Table].[Date Aproved by GM PM for Invoicing],[Inscope
Table].[AT&T Extended Price] from [Inscope Table] where [Inscope Table].[Date
Aproved by GM PM for Invoicing]<>"" and [AT&T Extended Price]<>0
 
Do you have any idea how to format a combobox, or textbox, in code. For
instance I am try to format a combobox, that normally takes a "Number", to
accept a text. How do I go about doing that?

Wayne-I-M said:
Try

SELECT [Inscope Table].[Date Aproved by GM PM for Invoicing], [Inscope
Table].[AT&T Extended Price]
FROM [Inscope Table]
WHERE ((Not ([Inscope Table].[Date Aproved by GM PM for Invoicing]) Is Null)
AND (([Inscope Table].[AT&T Extended Price])<>0));

Or

SELECT [Inscope Table].[Date Aproved by GM PM for Invoicing], [Inscope
Table].[AT&T Extended Price]
FROM [Inscope Table]
WHERE ((([Inscope Table].[Date Aproved by GM PM for Invoicing]) Not Like "")
AND (([Inscope Table].[AT&T Extended Price])<>0));

--
Wayne
Manchester, England.



Ayo said:
I know something is wrong with this select statement, but I don't know what
it is. Please help. Thank you.

Select [Inscope Table].[Date Aproved by GM PM for Invoicing],[Inscope
Table].[AT&T Extended Price] from [Inscope Table] where [Inscope Table].[Date
Aproved by GM PM for Invoicing]<>"" and [AT&T Extended Price]<>0
 
Nope - lost me on that one. It can be done but I can't see your application
so I can't work out why you would want to.

The bound field (table or query) in a combo should (most of the time) be the
primary field - which is (most of the time) an atuonumber or some other
unique set of data.

You don't need to " code " the combo. You could use a base query for the
combo to convert a number to text and have his isplayed to a user but this
would not affect the bound column.

If you work out what you're trying to get and post another question with
informtion someone will give you an answer. But I would play around with a
base query for the combo to convert number formats to text and use this as
the "displayed" column in the combo 1st.
You can either use a module to do this in the form or a simple "format" in
the comb's query (using a calculated column) eg. Format( NumberHere, "0.0" )
or Format( NumberHere, "000" ) or Format( NumberHere, "£#,##0.00") etc,
etc, etc

--
Wayne
Manchester, England.



Ayo said:
Do you have any idea how to format a combobox, or textbox, in code. For
instance I am try to format a combobox, that normally takes a "Number", to
accept a text. How do I go about doing that?

Wayne-I-M said:
Try

SELECT [Inscope Table].[Date Aproved by GM PM for Invoicing], [Inscope
Table].[AT&T Extended Price]
FROM [Inscope Table]
WHERE ((Not ([Inscope Table].[Date Aproved by GM PM for Invoicing]) Is Null)
AND (([Inscope Table].[AT&T Extended Price])<>0));

Or

SELECT [Inscope Table].[Date Aproved by GM PM for Invoicing], [Inscope
Table].[AT&T Extended Price]
FROM [Inscope Table]
WHERE ((([Inscope Table].[Date Aproved by GM PM for Invoicing]) Not Like "")
AND (([Inscope Table].[AT&T Extended Price])<>0));

--
Wayne
Manchester, England.



Ayo said:
I know something is wrong with this select statement, but I don't know what
it is. Please help. Thank you.

Select [Inscope Table].[Date Aproved by GM PM for Invoicing],[Inscope
Table].[AT&T Extended Price] from [Inscope Table] where [Inscope Table].[Date
Aproved by GM PM for Invoicing]<>"" and [AT&T Extended Price]<>0
 
Wayne gave you the answer but he didn't explain the problem.


"" is a zero-length-string, it is not the same thing as Null.
Dates are numeric fields and numeric fields are not strings. Therefore, use
Null when looking for "empty" numeric fields. You should also be aware that
depending on how you define text fields, you may end up with ZLS in them as
well as Nulls and so unless you specifically prohibit ZLS from your text
fields, you need to consider both values when looking for "empty" string
fields.

Where MyDate Is Null

Where MyTextField & "" = "" <------ this is a little trick that turns a
null field into a ZLS so you can do a single compare rather than two
compares.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top