Stupid question I'm sure.....
Field entryType has values of ##/y and ###/y.
In a simple Access SQL I'd like to trim, from the right up to the "#".
I don't need/want the "/y"
Thanks!
10 1701 MMcCarthy 14,534
Recognized Expert Moderator MVP
Thanks!
I tried this and received an #Error?
MMcCarthy 14,534
Recognized Expert Moderator MVP
OK change the query view to SQL and post the full query here.
nico5038 3,080
Recognized Expert Specialist
Guess you worded your question a bit vague.
I think you want to get the ## or ### and ignore the /y
Then use: -
left([fieldname],instr([fieldname],"/")-1)
-
When the "/y" is a literal you could also use: -
Replace([fieldname],"/y","")
-
Nic;o)
Thanks Guys!
Nico', that worked perfectly!!! Sorry my initial question wasn't quite clear.
To take it one step further....there are several records that are missing data in the field. For these records, the query returns the #Error code. Is there a way (IIF?) I could display a 0 rather than the err?
I'm trying to get this on my own using IIF, not sure if this is the right route.....
MMcCarthy 14,534
Recognized Expert Moderator MVP
There are a couple of ways you could do this but try ... -
IIf(NZ([fieldname],"")<>"",left([fieldname],instr([fieldname],"/")-1),"")
-
nico5038 3,080
Recognized Expert Specialist
Good sample Mary, but it can be done a bit shorter: -
IIf(IsNull([fieldname],"",left([fieldname],instr([fieldname],"/")-1))
-
' or better when also empty fields or fields without a "/" exist:
-
IIF(Instr(NZ([fieldname),"/")>0,left([fieldname],instr([fieldname],"/")-1),"")
-
I would use the second proposal as that's really 100% "safe".
Nic;o)
MMcCarthy 14,534
Recognized Expert Moderator MVP
I like the second one too :D
It allows for all eventualities.
I used Msquared's code - it worked fine!
I'm using this IIF in an Append Query.
Is it possible, to insert/display a 0 when the field is blank?
MMcCarthy 14,534
Recognized Expert Moderator MVP
Just change the last set of empty double quotes in the IIf statement to 0.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Wayne Wengert |
last post by:
I use statements like LEFT(textstring,6) in my app. I have "Imports
Microsoft.VisualBasic" at the top of the code but to use LEFT I have to code
:
Microsoft.VisualBasic.Left(sting, integer)
If...
|
by: Harlan Messinger |
last post by:
What is *supposed* to be the way to specify the horizontal offset of (a) the
list item's marker and (b) the list item's content? In particular, see
...
|
by: jbm05 |
last post by:
Hi,
I'm curious about the computational complexity of a query I have. The
query contains multiple nested self left joins, starting with a simple
select, then doing a self left join with the...
|
by: fleemo17 |
last post by:
For increased accessibility, I've replaced "display:none" with the
Off-Left method of hiding my CSS drop-down menus because the Jaws
screen reader doesn't see any of the menus hidden with...
|
by: Nathan Given |
last post by:
Hello All,
I am trying to debug a broken query. The query uses
Left$(,4) instead of Left(,4).
What is the difference between the Left() and Left$() functions in
Microsoft Access?
Thanks!...
| |
by: jonipony |
last post by:
HELP: Float Left box is drifting to the right in ie!
--------------------------
I need som HELP with my CSS coding!
On the following web page my design falls apart at screen size 800 x
600...
|
by: marco |
last post by:
Hi !
I have this part of code and i can not find out why the scroller is starting
from left to right instead RIGHT to LEFT.
This is the main part and the scroller is working fine but from the...
|
by: Samuel Rhodes |
last post by:
Hi
I am trying to write a code snippet that would display a '?' sign on the top
left of a control.
I do not want to hard code the positioning of the DIV which will contain
that '?'.
Is it...
|
by: =?Utf-8?B?R3JlZw==?= |
last post by:
I have two questions with regards to the LEFT function.
I ran into a problem with the LEFT function today. I knew it was a valid
Function, but when I tried to use it, it was getting interpreted...
|
by: moondaddy |
last post by:
I have a wpf project where I use a canvas to drag shapes around. when I
drag a shape beyond the right or bottom side I get scrollbars which is good.
I also get scrollbars when I zoom in and a...
|
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,...
| |
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...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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...
|
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: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |
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...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |