473,487 Members | 2,680 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

type conversion failure while append query

2 New Member
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 :-
Expand|Select|Wrap|Line Numbers
  1. IIf(Len(CDbl([a.text]))<8 And Mid(CDbl([a.text]),8,1)<>5 Or Mid(CDbl([a.text]),8,1)<1,(Round(CDbl([a.text]),3)),CDbl(Round([a.text],3)+0.001))
Sep 24 '07 #1
2 2108
yashgvt
4 New Member
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 :-
Expand|Select|Wrap|Line Numbers
  1. IIf(Len(CDbl([a.text]))<8 And Mid(CDbl([a.text]),8,1)<>5 Or Mid(CDbl([a.text]),8,1)<1,(Round(CDbl([a.text]),3)),CDbl(Round([a.text],3)+0.001))
Hi Durgapur,

Len(CDbl([a.text] : Len() function will be used only with string/varchar datatypes so don't convert text to decimal before checking the length [Same for other functions].

Try this
Expand|Select|Wrap|Line Numbers
  1. IIf(Len([a.text])<8 And Mid([a.text],8,1)<>5 Or Mid([a.text],8,1)<1,(Round(CDbl([a.text]),3)),Round(CDbl([a.text]),3)+0.001))
Hope this helps
Sep 24 '07 #2
pbmods
5,821 Recognized Expert Expert
Please use CODE tags when posting source code:

[CODE]
Source code goes here.
[/CODE]
Sep 24 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2979
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...
0
3937
by: s_gregory | last post by:
The mdb is considerable size 70 +- mb. A complex union query was working well, but when an additional union select... was added into the query, selecting identical fields from a different source,...
1
2467
by: David Barger | last post by:
Greetings, It appears that an Append Query I run in Access XP is randomly failing to append a field. I have payroll data being entered into a payroll database. This data is exported daily to...
10
1647
by: Arno R | last post by:
Hi all, I have a database that I need to use in different versions of Access. This is A97 in most places and A2k in a few other locations. (I develop in A97 and convert the db to A2k for these...
2
14385
by: john in fl | last post by:
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...
2
12181
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
2779
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
3129
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...
1
3742
by: billa856 | last post by:
Hi, I am trying to insert Null value in column(ShipDate) in my table.That column(ShipDate)'s type id date/time and format is short date. I am using "" to insert Null in that column(ShipDate)...
0
7106
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7137
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7349
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5442
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4874
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3076
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
600
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
267
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.