473,383 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Type Conversion Failure

Hello Everyone,
I have an Append Query that worked fine in Access97 but now fails to
work in Access 2000. The error that occurs is that it puts null values
in a field due to a "Type Conversion Failure".

The field in question is set up as a Long Integer in the target table.

When creating values, the Append Query performs a "group by" on this
field, and, although it leaves the data format blank, only offers
date-related options for formatting. It will not let me format the
field as a long integer in the query.

The difference between the Long Integer format in the target table and
the blank/date format generated by the Append Query appear to be
causing the error.

I'm stumped as to how to correct this...thanks in advance for any
assisstance.

John

Feb 26 '06 #1
2 14378
John, can you typecast the field in your query?

For example, you have this in the Field row:
[Field1]
try replacing it with:
CLng(Nz([Field1],0))

The Nz() is also needed since CLng() can't handle nulls.

More info on typecasting:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"john in fl" <jo**********@medtronic.com> wrote in message
news:11*********************@v46g2000cwv.googlegro ups.com...
Hello Everyone,
I have an Append Query that worked fine in Access97 but now fails to
work in Access 2000. The error that occurs is that it puts null values
in a field due to a "Type Conversion Failure".

The field in question is set up as a Long Integer in the target table.

When creating values, the Append Query performs a "group by" on this
field, and, although it leaves the data format blank, only offers
date-related options for formatting. It will not let me format the
field as a long integer in the query.

The difference between the Long Integer format in the target table and
the blank/date format generated by the Append Query appear to be
causing the error.

I'm stumped as to how to correct this...thanks in advance for any
assisstance.

John

Feb 26 '06 #2
Allen,
Thanks...I got it to work !

John

Allen Browne wrote:
John, can you typecast the field in your query?

For example, you have this in the Field row:
[Field1]
try replacing it with:
CLng(Nz([Field1],0))

The Nz() is also needed since CLng() can't handle nulls.

More info on typecasting:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"john in fl" <jo**********@medtronic.com> wrote in message
news:11*********************@v46g2000cwv.googlegro ups.com...
Hello Everyone,
I have an Append Query that worked fine in Access97 but now fails to
work in Access 2000. The error that occurs is that it puts null values
in a field due to a "Type Conversion Failure".

The field in question is set up as a Long Integer in the target table.

When creating values, the Append Query performs a "group by" on this
field, and, although it leaves the data format blank, only offers
date-related options for formatting. It will not let me format the
field as a long integer in the query.

The difference between the Long Integer format in the target table and
the blank/date format generated by the Append Query appear to be
causing the error.

I'm stumped as to how to correct this...thanks in advance for any
assisstance.

John


Feb 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Batista, Facundo | last post by:
Here I send it. Suggestions and all kinds of recomendations are more than welcomed. If it all goes ok, it'll be a PEP when I finish writing/modifying the code. Thank you. .. Facundo
5
by: Tongu? Yumruk | last post by:
I have a little proposal about type checking in python. I'll be glad if you read and comment on it. Sorry for my bad english (I'm not a native English speaker) A Little Stricter Typing in Python...
5
by: Hayato Iriumi | last post by:
When converting a type to another using CType and if the type conversion fails, it throw an exception. However, in C#, there is a keyword "as" which only makes the variable Nothing (null) without...
1
by: Alan | last post by:
OK this is a weird one. I've got an import routine going whereby name and address data is pulled into a table from a csv file. I'm having strange results when importing postcode/zip data into...
2
by: Reedsp | last post by:
OS: MS XP Access version: 2003 SP2 I am trying to use an update query to replace quote marks with nothing. In essence, I'm removing quote marks. I get a error message when a field is empty or...
6
isben22
by: isben22 | last post by:
I am a beginning developer using ACCESS 03 and Share Point Portal 2003. I have a list of events with start and stop dates in SharePoint that I want to pass to and Access Data Base. Ultimatly I...
8
by: Smithers | last post by:
Are there any important differences between the following two ways to convert to a type?... where 'important differences' means something more profound than a simple syntax preference of the...
2
by: durgapur | last post by:
hi, i am trying to round off the value of a text field and then append it to a decimal field, but it's giving type conversion failure, below is the query plz help :- IIf(Len(CDbl())<8 And...
4
by: smugcool | last post by:
HI, I am trying to import an excel data. All the fields are geting imported properly. But i am geting error in the date field. I tried to keep the format both in excel and access very similar.But...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.