Re: "Numeric->Text" Type conversion in "Make Table" Query

From: John Spencer (MVP) (spencer4_at_comcast.net)
Date: 04/14/04


Date: Wed, 14 Apr 2004 13:46:09 -0400

You might try the CStr conversion function. You will get an error on that if
Country is a null, but that can be handled. If country can be null then I would
try IIF(Country is null, Null, CStr(Country)). If Country is never null, then
CStr(Country) should work.

SELECT IIF(Country is null, Null, CStr(Country)), OtherFields
FROM ...

TDN wrote:
>
> Hi,
>
> been looking hours for a sloution but without success.
> maybe anyone can help:
>
> task:
> a "Make Table" query shall create a table with mostly text
> fields, but the original table contains several numeric
> fields (that access 97 sometimes imports as text fields!).
>
> the "make table" query uses the command
> SELECT Str(COUNTRY) as COUNTRY;
>
> problem:
> the type conversion works fine if COUNTRY is a numeric
> field. but unfortunately, access sometimes sets the field
> type to "text" during import with the result that the Str
> ()-fuction produces an error and ignores al data.
>
> QUESTION:
> is there a way to create a new field of the type "Text" in
> a make table query no matter what the source field type is?
>
>
> been looking on the web for 3 hours now, without success.
> it cant be that noone ever encountered this issue...
>
> any comments really appreciated.
>
> thanks
>
> TDN



Relevant Pages

  • Re: Was the Iraq War Worth It?
    ... had we not removed Saddam and Iraq turned into another training center for international terrorists there is good reason to believe terrorists would have utilized all of Hussein's scientific resources for WMDs. ... this country handle if we cannot pacify a country like Iraq, ... is success in Iraq important or not important. ...
    (soc.retirement)
  • Re: Was the Iraq War Worth It?
    ... had we not removed Saddam and Iraq turned into ... I worry when we cannot pacify a country of 25 million. ... is success in Iraq important or not important. ...
    (soc.retirement)
  • Re: Was the Iraq War Worth It?
    ... had we not removed Saddam and Iraq turned into ... I worry when we cannot pacify a country of 25 million. ... is success in Iraq important or not important. ...
    (soc.retirement)
  • Re: Was the Iraq War Worth It?
    ... I asked what would you think if Iraq turned into another Afghanistan ... I worry when we cannot pacify a country of 25 million. ... is success in Iraq important or not important. ...
    (soc.retirement)
  • Re: Important or Not Important
    ... success is a major political defeat for them. ... civil war from which there does not seem to be any exit for us. ... The less violent ones among them are getting out of the country ...
    (soc.retirement)