473,396 Members | 1,834 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,396 software developers and data experts.

Joining strings from fields with null values

What is wrong with the following:
UPDATE enq SET enq.DUP = Left$([enq]![n2],3)&Left$([enq]![postcode],3)&Right$([enq]![postcode],3)&Left$([enq]![a1],2)&left$([enq]![email],5);

According to ACCESS 97 Help, using & instead of + should overcome the problem of having null values in some of the fields I am using in the above query to create a unique ID.
In actual fact it behaves no differently, refusing to include the null values and consequently not updating the many records that contain the field with null value.
Stewart

*****************************************
* This message was posted via http://www.accessmonster.com
*
* Report spam or abuse by clicking the following URL:
* http://www.accessmonster.com/Uwe/Abuse.aspx?aid=cbd49c7f79b6424cb1c88a3e3232f86b
*****************************************
Nov 13 '05 #1
1 1909
You can't take a Left$ (or Right$) of a null. If [enq]![n2] is null,
Left$([enq]![n2],3) will return an error. Left$([enq]![n2] & "", 3) should
work, however, returning "" if the field value is null.
"stewart palmer via AccessMonster.com" <fo***@AccessMonster.com> wrote in
message news:cb******************************@AccessMonste r.com...
What is wrong with the following:
UPDATE enq SET enq.DUP = Left$([enq]![n2],3)&Left$([enq]![postcode],3)&Right$([enq]![postcode],3)&Lef
t$([enq]![a1],2)&left$([enq]![email],5);
According to ACCESS 97 Help, using & instead of + should overcome the problem of having null values in some of the fields I am using in the above
query to create a unique ID. In actual fact it behaves no differently, refusing to include the null values and consequently not updating the many records that contain the field
with null value. Stewart

*****************************************
* This message was posted via http://www.accessmonster.com
*
* Report spam or abuse by clicking the following URL:
* http://www.accessmonster.com/Uwe/Abuse.aspx?aid=cbd49c7f79b6424cb1c88a3e3232f86b *****************************************

Nov 13 '05 #2

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

Similar topics

3
by: Stefan Weiss | last post by:
Hi. The manual for pg_fetch_result() reads: | All forms of integer types are returned as integer values. All | forms of float, and real types are returned as float values. Boolean | is...
1
by: Joe | last post by:
I've got 3 columns in a mysql database that I am trying to join. I'm using CONCAT(), but it's giving me NULL results. This has worked for me before ... What am I doing wrong? Here's a straight...
2
by: James | last post by:
Can anyone please shed some light on the following... I have a framework that uses dynamically created tables, named using an incremental "attribute set ID", as follows: attrdata_1 attrdata_2...
2
by: Shaggy Dragon | last post by:
Hi there, been looking for a solution to this for some time now. I've a UNION query that produces a table called AllSecurities: SELECT SecurityNumber, Book AS AllSecurities FROM Trades UNION...
2
by: VMI | last post by:
In my datatable, I'm retrieving three fields from an Access table and I concatenate them into one string. Then I put this information in another datacolumn that I added to the datatable (with...
4
by: Randall Parker | last post by:
I am designing a database schema. It happens to be in MySQL but I'm trying to keep it portable to other databases should the project grow. Anyway, suppose you have VARCHAR fields and will be...
12
by: veaux | last post by:
Question about joins in queries. I have 2 tables with a field called "ID". Table 1 Rec1 = Jan12FredFlintstone Rec2 = Feb01WilmaRubble Table 2 Rec1 = Jan12BarneyRubble Rec2 = Mar03SamSlate
5
by: mike | last post by:
Question. I have a new table that I am adding to a script that I wrote. This table has 3 fields, the first 2 fields are used in the on statement as being = other fields in the script. The...
1
by: jladiaz | last post by:
Hi everybody! I´m new at this and I realize there´s a lot of great and smart people, so let´s see if anybody knows how to do this. I have a table where i need to combine 2 fields in another....
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.