Make Table from Query

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

Hi,

When I create "iif statement" before making a table. The field has text
and size of 255 but I want to make it into "number and size of 8" instead of
"Text and size of 255".

Your help would be much appreciated.

Example: IIf(
Code:
<>[IDNumber],[CodeName])

The field name "Example" has text and size of 255 after making the table.
Is there a way to set Example that has number and size of 8?

Thanks
 
Hi,

When I create "iif statement" before making a table. The field has text
and size of 255 but I want to make it into "number and size of 8" instead of
"Text and size of 255".

Your help would be much appreciated.

Example: IIf(
Code:
<>[IDNumber],[CodeName])

The field name "Example" has text and size of 255 after making the table.
Is there a way to set Example that has number and size of 8?

Thanks
[/QUOTE]

Is the field CodeName in fact numeric? What does the table contain?

You can coerce the IIF to return a Long Integer:

Example: CLng(IIF([Code] <> [IDNumber], [CodeName], "0"))

Your IIF should have three arguments: the expression, the value to be
returned if the expression is true, and the value to return if it is
false. What should Example be set to if IDNumber *IS* equal to Code?

John W. Vinson[MVP]
 
If the Text can *always* be converted to numeric value, use CLng() to
convert the Text value to a Long value.

You can use the function IsNumeric() to check whether the Text value can be
converted to a numeric value.
 

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