Blank Spaces

Nov 28, 2005

Hello,
I have the following SQL query that runs perfectly. Now I need to put some blank spaces in between for the first expresion (EXPR1). At the moment, as you can see, brings me the 4 fields together.

I have tried using + ' ' + and + " " + but it won't let me as it says that the syntax is Incorrect. What should I use to get spaces?
Thank you!

**********

SET @SQL = 'SELECT dbo.brnch.addr + dbo.brnch.suburb + dbo.brnch.state + dbo.brnch.PIN AS EXPR1, dbo.individuals.posit, dbo.individuals.phn, dbo.company.name

FROM dbo.company INNER JOIN
dbo.brnch ON dbo.company.ID = dbo.brnch.com_ID INNER JOIN
dbo.individuals ON dbo.brnch.br_ID = dbo.individuals.br_ID INNER JOIN

WHERE dbo.brnch.country in (' + @OrderList + ') '

EXEC(@SQL)

View Replies


ADVERTISEMENT

Blank Spaces

Feb 26, 2008

My database:
*TblNames
-NameId
-FirstName
-LastName
-UnitID
-AreaID
-RoomID
*TblUnitID (this table doesn't matter)
*TblAreaID (this table doesn't matter)
*TblRoomId
-RoomID
-RoomLabel
I hope you can follow me fine up to this point.
"think of this database as a hotel"
I need a report that looks like:
LastName FirstName Area RoomLabel
name1 name1 B 1
name2 name2 B 2
[empty] [empty] B 3
name3 name3 B 4

As you see not all the rooms are occupied therefor where you see [empty] a blank space must appear or something like [empty] so it indicates that the room is empty.
My problem is that when i do my query it will only show data that has all the fields requested for instance if I know the last name of a client but i don't know their first name, the query will not show this field. even tho there is a client using a room. I don't know how to explain my problem any better. any suggestions?

View 6 Replies View Related

Forms :: Blank Spaces In Listbox

Mar 10, 2015

I have a listbox in my database to show the items filtered from comboboxes. But, I could see several blank spaces on the right most part whenever I scroll my database on the right side. how to delete those blank spaces? by the way, i have correct/exact column count already.

View 11 Replies View Related

Reports :: Avoid Blank Spaces

Mar 21, 2014

I have the follwing three quantities: category, month and value.so I would like a report to place each value in the corresponding row (category) and column (month).using a cross tab query this is quite easy, and I also managed with a simple query, by placing 12 textboxes in the report and using the iif instruction (iif month-jan,value,null and so on for each month).

now the problem arises when i have two values for the same category but in different months. In this case, the report will place the last value in the line below the previous, leaving a blank space.I'll upload an example asap, in the meantime i try to explain it here below:

.......jan..feb..mar..
cat1 10
cat2 30

View 1 Replies View Related

Blank Spaces After Data In Field Is Causing Problems

Aug 30, 2006

Hi Folks,

I am creating an IF CASE statement in SQL that basically takes the 2 last characters in a field and if they happen to be 'HX' then a special rate is used to calculate the cost whereas if their is no 'HX' as the last 2 characters of the field then a different rate is applied.

(Right([BOARD SPEC DATA],2)) has always worked flawlessly in SQL to render similar solutions. However, unfortunetly the weekly extract that comes into us permits for massive amounts of blank but real spaces after the data in [BOARD SPEC DATA] field so what ends up happening is that (Right([BOARD SPEC DATA],2)) yields a (SPACE SPACE) value even thou many of these values should be 'HX' as they are the last 2 real non-space values at the end of the field.

If there any easy way to fix this keeping in mind that this is how we get the extract everyweek so a search/replace on spaces won't work ... is there any way I can use a Right command but ignore spaces so that it simply renders the 2 real characters at the end of the field as oppossed to blank spaces?

Any help is greatly appreciated.

Thank you very much,


Joe

View 3 Replies View Related

Blank Spaces In Data Fields After Copying Data With SQL

Apr 14, 2007

Hello there, I'm having a problem very much like the one described by this user (http://www.access-programmers.co.uk/forums/showthread.php?t=113742&highlight=SQL+blank+spaces) where an SQL statement I am using to read data from one table and copy it to another is filling the remaining field space with blanks.

I didn't notice until a VBA module I worked on later on which was to read data from the new table and copy the selected record into a form said it could not find the records. The code:

Do Until blnFound = True Or rs.EOF
'DEBUG: answer = MsgBox("ok", vbYesNo)
'DEBUG: MsgBox rs("Account Name")
If rs("Account Name") = strAName Then
MsgBox "DEBUG: FOUND " & rs("Account Name")
blnFound = True
End If

rs.MoveNext
Loop


The record selector just goes straight to EOF because rs("Account Name") never matches strAName (as strAname has all those damned spaces after the useful data).

I wondered if perhaps there was some way to use the code in the other thread to read the length of useful data and then chop off the garbage spaces afterwards, but I'm worried it would be incredibly slow when running through the thousands of records. Also, the field has legitimate spaces in between words (most of the account names are two or three words in length).

The SQL statement responsible is as follows:
strASQL(i) = "INSERT INTO " & strTableName & "([CAccount No], [Short Name], " & _
"[Account Name], [Telephone], [Fax], [Contact Name], " & _
"[Mail address1], [Mail address2], [Mail address3], [Mail address4], " & _
"[Analysis1], [Analysis2], [Analysis3])" & _
" SELECT [CAccount No], [Short Name], " & _
"[Account Name], [Telephone], [Fax], [Contact Name], " & _
"[Mail address1], [Mail address2], [Mail address3], [Mail address4], " & _
"[Analysis1], [Analysis2], [Analysis3] " & _
"FROM tblCustomer WHERE [" & strField(i) & "] LIKE '" & strValue(i) & "';"

strASQL, strField and strValue are arrays and this SQL statement runs in a loop, as this is part of a search form for multiple possible entries. It all works fine except it always adds those damned spaces :D

Any suggestions?? Cheers.

View 12 Replies View Related

Queries :: Pulling Records Based On Blank / Non-blank Criteria

Jul 18, 2013

I have a couple different reference files that get updated each week. Sometimes there are missing data elements, so I'd like to structure a select query to show me those records that have blank elements but I'd like the similar records to be pulled in as well, so I can make a determination as to how to populate the blank records..

See attached example: I have a client ID reference table that gets populated with forecast owner names (individuals responsible for the customer) from a couple of different sources. Sometimes there are names attached and sometimes the field is blank.

How can I structure a query to show me just those Client ID's that have multiple entries with blank AND non-blank forecast owners? I'd also like to exclude single/multiple records where there are only blank records...

View 3 Replies View Related

Query Criteria With Blank And Non-blank Text Records

Mar 13, 2007

OK, I have been searching around on the fourm for over an hour now...I give up. If this is some where else, I am sorry.

I have a database of maintenance data. There are several columns that are usually filled in, some records have some columns blank. They are formated text because they hold letters and numbers (see pic).

I am using a form to query the table...no problem. The form has text boxes the user filter down the data

The problem comes are with the results of the query. Any record that has a blank column is not retuned. I am using "Like" so that the user can enter in partial codes. I know "like" won't return "null" records.... Help!

Things I have tried:
1)IIF(form field is blank, return table field, else use like command to filter) - returns nothing!
2)Like "*" & [Forms]![Fleetwide_data_Request]![MAL_CD] & "*" returns all records without blanks (i.e. missing data)

what else can I do?


Thanks

View 5 Replies View Related

Spaces

Mar 17, 2008

I have a table w/field set as text that I don't want users to enter a "space" into, how would I stop this? I suspect " " in the field validation field? Does this sould correct? What does everyone else use?

View 4 Replies View Related

Disable Spaces

Dec 7, 2007

Hi, I have a text box in a from for data entry, how do I disable a space. For example I don't want the user to have a space between charaters or before and after a charater. Thanks.

View 7 Replies View Related

Trailing Spaces

Mar 10, 2005

Hi, I hope everyone is well.

As part of an extraction program I'm making, I've got a table (lets call it TABLE1) with values that have trailing spaces
e.g. "ENGINEERING ", "LOGISTICS ", etc....

This has been set up as such to match the values that exist in a read only table I am linking to from another database.

I have used a query of TABLE1 as a row source for a combo box. When the values are selected in the combo box the trailing spaces are lost.

Can I remedy this?

Thanks in advance :)

View 3 Replies View Related

Spaces In String

Aug 8, 2005

How can I remove the spaces in the example string!

HICX108-Standard Top -Vendered

Thanks in advance!

View 2 Replies View Related

Remove Spaces

Nov 4, 2005

Hi,

i want to replace spaces in my query, but there are a few hard parts in it.
I dont always know how many spaces. en second, the spaces that need to be replaced are after the first character. The rest needs to be removed.

i have:
----1----1----2

the "-" are spaces!!
and i want it to show
1.1.2

this is what i tried replace([MinutesID];" ";".") & " - " & [minutesTitle]

can someone assist...
thanks

View 2 Replies View Related

Remove Spaces In Between

Feb 22, 2008

Hi,

Is there a way that i can remove the space in between the cahracters of the string.

like: 78- ASDGFKGJ OR 78-SJDHF AJSDFH TO RESULT IN 78-ASDGFKGJ / 78-SJDHFAJSDFH

THANKS SO MUCH

View 10 Replies View Related

Spaces In Form Name

Jun 6, 2007

I have used spaces in the names of my tables, queries, forms and reports. I'm beginning to think this may have been a mistake, as I'm having trouble with syntax.

I have a form called Number of Words. This contains an option box, for which I always want option1 to be the default whenever the form is opened.

So I tried doing Forms!Number of Words!Option1.SetFocus but it didn't like the syntax. Do I perhaps need square brackets or something?

View 3 Replies View Related

Combining 2 Fields Into 1 Without Spaces

Jan 26, 2006

I have 2 seperate fields within a select query (In this example Field 1 - Country and Field 2 Number).

I have combined the 2 together into one field.

However a space appears within my results i.e


Field 1 Country Field 2 - Number
----------------- -------------------
England 4
USA 10

Combined fields:

Field 3 - Combined Country + Number
--------------------------------------------

England 4
USA 10

How can I remove this space within Field 3


Thanks

View 4 Replies View Related

Empty Spaces Issue

Aug 6, 2007

Hi,
I imported an Excel spreadsheet into Access. As you know, Access will automatically create 255 characters size for each 'text' datatype.

Now the issue is, when I create a query and I specify
Right([Field Name],3) I get no/empty results. I know my query syntax is correct, but the issue is, Access is picking up the right 3 character of the 255 field size. But in reality, my field's data are not 255 characters long; the max is probably 30 characters.

So, the question is, how do I go about picking up the 'actual' right 3 characters?

Please advise. Thanks!

Leon

View 4 Replies View Related

How To Add Spaces To Text String?

Sep 21, 2005

Access 2000. I have table of many hundreds of records. One of th fields of text looks like this: XXXXXXXXXXXX and I want it to look like this: XXX XXX XXX XXX by adding the spaces. Would someone please show me how to write the function or code to add the spaces to the text as shown : Thanks :o

View 3 Replies View Related

Spaces, Underlines And Dashes

May 1, 2007

I have a db, that I used to maintain as a end user, now it's in a multiuser environment, problem is the user has to enter job numbers.
Below are all valid job numbers, therefore a mask will not work.
So I was thinking "HOW" could this be done, perhaps eliminating Spaces, underlines and dashes from this field. How would I do this on the same field for all 3 conditions (course i would have to backtrack)

01-AB134
02-091
2-2177
3-715
03-021-A
05-001-PBPL
07-07-955

View 4 Replies View Related

Fields With Trailing Spaces.

Jul 31, 2007

I have tables that get their data from SQL server. Some of the fields in the table have trailing spaces. Does this issue need to be resolved in SQL server or in Access?

View 4 Replies View Related

I Want Spaces In A Table Using A Updatequery

Nov 7, 2005

hi,

I want to put spaces in a table. With spaces i mean for example: i have the word "hallo" and i want it to be writen in the table as: "____h____a_____l_____o"
the _ are spaces. I have the string perfectly in a variable. But when i add it to the updatequery i get an syntax error on the string.

I used the following query:
cnn.Execute "UPDATE Minutes SET Minutes.MinutesID = " & strFinal & " WHERE (Minutes.MinutesCode)= " & [Forms]![MinutesMF]![itemlist].Column(4) & ";"

View 1 Replies View Related

How To Remove Spaces Between Numbers?

Dec 2, 2005

Hi
I have big problem and i have to find solution within one hour

I have numbers like this
"space"numbers"space"numbers"

I would like to cut the spaces
I know there is trim function but i'm pretty beginner, i read help but i can't still use it and trim will work only on first space?
I'd be very thankful for giving me some practical example or explane?

Thank's a lot!

View 1 Replies View Related

Adding Trailing Spaces

Jan 9, 2007

I have a query that I need to add trailing spaces to. I have a query that pulls the first and last name of our employees, but after the initial text, I need to add spaces up to 20. So the text of the first name plus spaces would be 20 characters and the last name in a different field would be last name plus spaces would add up to 20.

Thanks for your help.

View 1 Replies View Related

Line Spaces In Query?

Jan 2, 2008

Hi,

Does anyone know if its possible to have a page break/line space in a query's results?

For example, a query returns 5000 results, and after every 45 there is a space of 2 or 3 spaces. When I say "space" it could be a couple of empty records or rows.

The reason I ask is because I use a query to filter the records I want from my table. I then use a make table query to make a new table with these records, then I use a macro to export the table into a .txt file.

This text file is then used as a product feed, except the web application I use to import the data can only take a maximum of 50 records - so it'd be nice to already have a space so when I cut and paste the records into the web application I don't accidently try to import 51 records and mess everything up.

I know it's a strange one, but if theres anyway of setting the format of the .txt file to contain spaces would save a lot of time.

Any ideas would be welcomed, thanks for your time.

Dean

View 3 Replies View Related

Capitalisation Recognise Spaces

Oct 4, 2005

Right ive searched the forum and people are just asking silly questions that can be answered with an input mask but.

What im looking for is to be able to type a name for example in one textbox and the textbox will Capitalize the first Name and recognise the space key has been pressed and Capitalize the first letter of Second Name

Thanks for any help

View 5 Replies View Related

Reserving Spaces On Rides...

Jan 12, 2008

Hi there,

I am currently working on a similar system that theme parks use as a 'fast pass' where the user an pre-book a place on a ride. I have only 5 tables consisting of a customer, card (membership card), session, reservation (composite table) and rides (park rides).

I need to make a reserve rides form which as user can reserve a place on a ride. When the user books it, a place from the rides session for that time is reduced by one...

Can anyone help me?

It would be greatly apprieciate it!

Noel

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved