SQL String

Jul 26, 2006

Hi Folks,

i am using the sql below but i am having a little syntax error:

i am trying to refer to a variable called strRAGCol


strSQL = "SELECT tblSite.SiteID, tblSite.SiteRAG, tblSite.Active " _
& " FROM tblSite " _
& " WHERE (((tblSite.Active)=Yes)AND((tblSite.SiteRAG)= strRAGCol));"

Any help much appreciated.

Mark

View Replies


ADVERTISEMENT

Modules & VBA :: Separate Numbers And String From Alpha-numeric String

Jun 7, 2013

MS-Access VBA code to separate numbers and string from an alphanumeric string.

Example:

Source: 598790abcdef2T
Output Required: 598790

Source: 5789065432abcdefghijklT
Output Required: 5789065432

View 13 Replies View Related

String Validation (string Must Start With Http://)

Mar 12, 2007

Hi all,

I was looking for some help. I am trying to setup a table with a field for web address. People are entering www.website.com etc however I need them to make sure it starts with http:// Is their any way I can put validation on the field to make sure that this is entered? Or maybe I could use an input mask?

Any suggestions would be gratefully recieved.

Andy.

View 3 Replies View Related

Search For A String Within A String

Oct 27, 2006

I have a column called CPU_S within a table called workstation that contains sample text like P111 933

I want to use the update command to search the CPU_S column for entries that contain this in there string then add P3 to a column called CPU_N

So far I have the code below but I don't know how to search a column entry for a specific string within a string. Can this be done and how?


UPDATE workstations SET CPU_N = "P4"
WHERE CPU_S = ;

View 3 Replies View Related

String Not Getting Any Value

Jun 8, 2005

It worked in acces 2000, and now am using acces 2003. Anybody any clue why the string strVoorstel would not get the value? It just returns nothing.

Here's the code:

Dim strVoorstel As String
Dim lngTel As Long
Dim strQer As String
Dim strDa As String
Dim lngNum As Long

...........

View 6 Replies View Related

SQL String Help Please

Sep 29, 2005

The following SQL query is returning no records when I know for a fact there are some there! Can anyone please hlp me?!

Dim strSQL As String
strSQL = "SELECT * FROM tblHirer WHERE HirerSurname= 'Forms!frmFinanceProposal!Child845!Text430'"
rsFindDuplicates.Open strSQL, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
rsFindDuplicates.RecordCount


Also, I was wondering how I would put as 2nd filter on the recordset to equal a particular date?

Cheers

View 2 Replies View Related

Sql String

Dec 16, 2004

I had a query and the sql is:

SELECT Institutions.*, Institutions.merge, Institutions.Inst_type
FROM Institutions
WHERE (((Institutions.merge)=True) AND ((Institutions.Inst_type)=[forms]![merge_inst_type]![Inst_type]));

and I had a command button which process

MergeAllWord ("select * from merge_query_true")

but I am getting an error like this "make sure the sql is correct , sql was
select * from merge_query_true

select * from merge_query_true ---- is this code ok?

If I had cut the part "AND ((Institutions.Inst_type)=[forms]![merge_inst_type]![Inst_type])); from the sql it works fine....

View 4 Replies View Related

SQL String

May 30, 2007

WHat am I doing wrong...I cannot get the syntax correct...

Form the Query Builder:

SELECT tbl_GroupMembers.GroupNumber, tbl_GroupMembers.Email
FROM tbl_GroupMembers
WHERE (((tbl_GroupMembers.GroupNumber)="10"));


NEED IT TO BE IN THIS SQL STATEMENT:

Set rs = dbs.OpenRecordset("Select * From tbl_Groups", dbOpenDynaset)

View 3 Replies View Related

String Length.

Aug 19, 2005

I have a fax number field iwhich has a mask. +(000)-00-000-000 in a table of many records.
The problem is that every record has a number in the first part of country code +(001)which must have come there by mistakes, few records have complete and true fax numbers.

I need a query that can Update this Fax_Number field where the length of the string is less than 7 digits.
Some thing like UPDATE Contacts SET Contacts.Fax_Number = ""
WHERE ((Len("Fax_Number")>"6"));

How can i do this. Thanks.

View 4 Replies View Related

How To Split Up This String

Sep 15, 2005

I have a string:

Cars > Car Import > Car Import: Car Import

The first section is the Category, the second is the Product, the third is the SubProduct and the fourth is the keyword.

What is the best way to split each of these words into its own variable? I think I can do the first and end one but not the Car Import and Car Import one.

Thanks,

Dave

View 4 Replies View Related

Lookup String

Sep 18, 2005

I have a 67 binary code string produced from a query which concatenates these 1's and 0's.

What I need to do is have access decide what a particular string value/range is and return the process name. e.g

11000000000000000000000000000000000001000010000000 00000000000000001. The process name would be COMP RESOLVED MSA


10100000000000000000000000000000000001000010000000 00000000000000001.The process name would be COMP UNRESOLVED MSA

00000000000000000111010000000110000000000000000000 00000000000000001

The process name would be MSA NEW

There could be about 60 different Process Names

View 1 Replies View Related

Please Look At This Boolean Vs String

Dec 2, 2005

I'm working on a software that was developed by someone who left the company. The problem is that the software works for all locations execpt one that is in austria, after debuging I found out that there is a statement in the code that uses boolean true or false, the only way it worked is when I put an if statement with false or true as string, ex: if doc = "true" then
buttom line has anyone faced this problem, I searched microsoft website and they said that some vb engines don't convert boolean to string. Please Please if someone has a clue try to help. Thanks.

View 4 Replies View Related

Need Help With String Formatting

Dec 15, 2005

Hey everyone, I need some help with formatting a string for use with the DoCmd.RunSQL() method. I can't figure out how the hell VB deals with escape characters for the purpse of variables inside strings. I have this line right now.

strSQL = "INSERT INTO OS (OS) VALUES(" + OS.Value + ")"


This is supposed to insert one row into the "OS" Table, in the "OS" field. In my form there is a textbox called "OS" and I'm trying to insert that value into the DB table.

Two things.
1) Yes, I know, I have a lot of things named "OS"
2) Yes, I know I don't need to use a string here, but I'm just presenting this is an abbreviated example, in my full program I do in fact need a string.

View 3 Replies View Related

String In Textbox

May 2, 2006

Hi,

I have string SELECT Field from Table:

A1
A2
A3
....

I need to see records in textbox: A1, A2, A3..

Thank You in Advance

View 1 Replies View Related

Compare SQL String

Jan 4, 2007

Hi, all.

I have string: strSQL = SELECT SUM column FROM table

I need compare it with constant number, for Example:

If strSQL > 50000 Then ....

its not working, any Ideas?

Thank You in advance

View 4 Replies View Related

String To Date

Jan 16, 2007

I have just inherited a database that has dates stored as strings ex.: 01/01/01. I really do not have time to add a new field and convert the string date to date format (this would cause a lot of rewrite to the application that is using this table). I am trying to use the 'between' to display records that are between specific dates. Also, I am using Cold Fusion as the front end, if that makes any difference. Below is an example I thought might work but did not:

<cfquery name="acty_due_month" datasource="customer">
SELECT acty_end_dt
FROM activity
Where DateValue(Format([acty_end_dt], "MM/DD/YY"))=10/30/05
</cfquery>

Any assistance would be greatly appreciated.

View 9 Replies View Related

String Concatenation

Sep 14, 2007

In the table, i already had a few columns:

string1 string2 string3
001 1 1.5
001 2 6.4


I'd like to add a new column and concatenate the strings in previous columns with additional characters:

string1 string2 string3 string4
001 1 1.5 c-001-b01_1_5x
001 2 6.4 c-001-b02_6_4x
002 3 7 c-002-b03_7x

Is there a good way to do this? Thanks in advance.

View 2 Replies View Related

Building SQL String As Sub For No Value

Jun 21, 2005

I'm running a 9 parameter query, where values for the criteria are drawn from a form. I'm confused as to how I build an "if, then" string so that if one of the parameters is left blank, the program will skip it and go to the next.

Any suggestions?

View 8 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

Please Help String Parse

Nov 11, 2005

Probably very simple but I cannot get the syntax right - it has been far too long since I used Access.

I am trying to seperate a field NAME from these formats:

LAST/FIRST M
LAST/FIRST

To two fields: Field LAST and field FIRST

Can someone please help?

Thank you! It is Friday and I want to go home!

View 1 Replies View Related

String Parsing.....

Feb 7, 2006

hi, im new to both access and sql and was hoping i could get some help...

i have a string of numbers seperated by commas stored in my database. i need to count how many numbers there are in each string and then display all the results with less than 36 numbers contained.

am i able to do this with an sql statement, or am i likely to need vba??

(example string: 9.89007472991943, 12.3332061767578, 14.4694166183472, 16.287145614624, 17.5347270965576, 17.6327610015869, 16.1364498138428, ...)

thx in advance

View 1 Replies View Related

String Searching

Mar 20, 2006

I have a problem with an SQL query that is used to create a report, the query itself works fine, however I need to get it to do something extra. Basically we have a column that contains 1-3 letters. The letters are A, B and C. The query searches the database and returns result depending on which of the letters we entered. We do this using the like statment -:

SELECT * FROM TableUser WHERE UserType LIKE B

So the above SQL statement returns all entries with the letter B in the column UserType. Also we my need to search for AB, which returns all entries with AB and ABC. The problem is that we sometimes need to search for AC, which should return the values AC and ABC. The problem is that it only returns the values AC and not ABC. I know why it does this as it is searching for a string like 'AC', I am just not sure how to get round the problem. Is there a way of searching the string for the Value AC so that it returns the entries AC and ABC.
Thanks in advance for any help.
Cheers
Andy

View 1 Replies View Related

Search A String...

Mar 25, 2006

I'm trying to create a query that searches the string in a field, for a substring that the user specifies when the query is run. This is the SQL code:

SELECT tblStatement.Date, tblStatement.[Payment Type], tblStatement.Details, tblStatement.[Paid Out], tblStatement.[Paid In]
FROM tblStatement
WHERE (((tblStatement.Details) Like "**"))
ORDER BY tblStatement.Date;

between those two asterixes on the WHERE line, I'd like a string that the user has been prompted for. I've tried this:

WHERE (((tblStatement.Details) Like "*[Enter a String]*"))

But that fails to work, I guess because its in quotations. If I simply had Like [Enter a String], then I get the prompt, but I'll need to enter a string which exactly matches what I am looking for. In other words, I need a query which will search say, "abcdefg" for the user defined input: "abc", which will return that result. I just dont know how to get this to work :s

View 1 Replies View Related

Invalid String For SQL!

Apr 20, 2006

Can anyone amend this statement because presently I am getting an eror 'The expression you entered has an invlid string 'WHERE Month([PaymentDate])>07 And <11'

View 2 Replies View Related

WHERE Clause In SQL String

Sep 3, 2007

Hi all, do you think you could help me with this SQL statement I'm using in vba code for a recordset object?

strSQL = "SELECT idCompactPartNumber, txtItem," & _
"lngDepartmentNumber , dteAquiredDate, curPrice," & _
"intQuantity , lngUnit, txtLocation," & _
"imgPicture, dteRetiredDate, blnActive," & _
"blnConsumables " & _
"FROM tblMaterials" & _
"WHERE lngDepartmentNumber=" & lngDepartment

When I try to open the recordset with this, it says there is an error in the WHERE clause. I've tried changing all sorts of things but nothing works. I've tried with the WHERE clause commented out and it all works fine then.

Hope you can help, thanks

View 5 Replies View Related

Get The Number Out Of A String

Nov 19, 2007

in the query design how can I extract a number out of string. ex
25 bp
234.56 bp

etc. ? I would have expected INT(FiledName) but it's not it

View 3 Replies View Related







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