Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2005

Tip: Looking for answers? Try searching our database.

Query for leading blanks

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kim - 13 Nov 2005 16:23 GMT
certain Is there a query that will search for a number of leading blanks? I
have a text file (notepad) of music listings that has the band name (with 6
leading spaces) and the next line is the album name (with 9 leading spaces).
After that, there could be another album name or the next band name. I am
trying to put these into a table that will show these seperately so I can
avoid a LOT of typing.
Thanks!
Rick Brandt - 13 Nov 2005 16:31 GMT
> certain Is there a query that will search for a number of leading
> blanks? I have a text file (notepad) of music listings that has the
[quoted text clipped - 3 lines]
> that will show these seperately so I can avoid a LOT of typing.
> Thanks!

SELECT *
FROM TableName
WHERE FieldName LIKE "      *"

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

Kim - 15 Nov 2005 02:58 GMT
That expression worked, but it isn't isolating only the name with a certain
amount of leading spaces. Any other ideas?

> > certain Is there a query that will search for a number of leading
> > blanks? I have a text file (notepad) of music listings that has the
[quoted text clipped - 7 lines]
> FROM TableName
> WHERE FieldName LIKE "      *"
John Vinson - 15 Nov 2005 04:01 GMT
>That expression worked, but it isn't isolating only the name with a certain
>amount of leading spaces. Any other ideas?
[quoted text clipped - 10 lines]
>> FROM TableName
>> WHERE FieldName LIKE "      *"

Try

WHERE FieldName LIKE   "      *"
AND FieldName NOT LIKE "       *"

to find records with six but not seven spaces.

                 John W. Vinson[MVP]    
Kim - 17 Nov 2005 02:47 GMT
Thank you so much - that worked great!

Now - any idea on how I could query that if the first field is blank, then
go to the next?

> >That expression worked, but it isn't isolating only the name with a certain
> >amount of leading spaces. Any other ideas?
[quoted text clipped - 19 lines]
>
>                   John W. Vinson[MVP]    
John Vinson - 18 Nov 2005 17:52 GMT
>Thank you so much - that worked great!
>
>Now - any idea on how I could query that if the first field is blank, then
>go to the next?

Now you'll have to explain that. "Go to the next"... field? Implies
incorrect table design. "next record"?

What's the structure of your table? Can you give some examples of the
data for which you're searching?

                 John W. Vinson[MVP]    
Kim - 21 Nov 2005 01:27 GMT
I have imported a text file of album names along with the artist name. Bad
thing - it was imported to where the names are all in one field. I have
seperated them into two fields, but now some fields are blank. Now I'd like
for Access to search for the next "not null" field to give me the album name.
Example: "Band name" in Name.txt followed by a blank, next record the band
name will be blank and Name2.txt will contain the album name. Some bands have
more than one album, then there will be another band name followed by a blank
Name2, etc. Any ideas? I have two more lists to import and they won't import
the same way - they will have both names in the same field. Just trying to
find the easiest way to do this without a bunch of typing - there's about 3K
songs in the lists.

Thanks,
Kim

> >Thank you so much - that worked great!
> >
[quoted text clipped - 8 lines]
>
>                   John W. Vinson[MVP]    
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.