Using A Question Mark As A Character Not A Wildcard In SQL Query
Jan 25, 2005
Hi,
In SQL in MS Access a '?' '*' '%' are all used as a wildcards.
I need to be able to retrieve all messsages which contain a '?' within the message.
i.e. If a message contains the following characters : why?
I want to retrieve the message as a '?' is part of the message.
When I write the code :
SELECT User.User, Message.Message
FROM Message INNER JOIN [User] ON Message.[Message ID]=User.[Message ID]
WHERE Message Like '*?*';
Access takes the '?' as a wildcard and retrieves all the messages in the database. Is it possible to get round this and use '?' as a specific character.. not a wildcard?
Please help
View Replies
ADVERTISEMENT
Aug 11, 2005
I've got a query that does exactly what this (http://www.access-programmers.co.uk/forums/showthread.php?t=89564&highlight=null+records) chap got his to do.
However I want to add a "*" character to the criteria to allow for searches with partial matches. Here's the criteria that works:
[title]=[Forms].[Search]![Title] Or [Forms].[Search]![Title] Is Null
However when I try the logical extension:
[title]=[Forms].[Search]![Title] & "*" Or [Forms].[Search]![Title] Is Null
this doesn't work, and nor does:
[title]=([Forms].[Search]![Title] & "*") Or [Forms].[Search]![Title] Is Null
WHAT DO I DO? I'M TIRED AND I CANT THINK STRAIGHT! :eek: thanks and sorry for being so dumb!
View 6 Replies
View Related
Aug 26, 2004
I am setting up my own switchboard, and i have a quick jump menu that has every page on it. The pages are arranged as so:
1
1.1
1.2
1.3
2
2.1
2.2
3
When i'm setting up my code to push a person to a certain page, I want it to first check their access level (which is stored in a table in my database)
Is there a wildcard character in vb that will cover all the submenu's?
(I.E. Code:If MainMenu = "1*" And Userlevel = "PublicAccess" Then MsgBox "You do not have access to this area"End If)
Instead of having to put an if statement for every submenu under 1?
View 2 Replies
View Related
Feb 1, 2006
Hello,
I am not sure if this is possible, but I am running an update query to add text in a field if a certain criteria is met. However, if the field I am adding to already contains what I am trying to add, i don't want it to add it again. Everything works fine except the IIF statement in my update field. Here is what I have:
IIf(Temp_Vendor_Trips.[Reco Classification]="*" & "V3" & "*",Temp_Vendor_Trips.[Reco Classification],Temp_Vendor_Trips.[Reco Classification] & " " & "V3")
If the field contains the text V3, I want it to be left alone and continue to show what is already in the field, if not, i want it to add V3 to the end.
Thanks in advance for the help!
View 1 Replies
View Related
Jul 12, 2006
Hi,
I'm making a query which is used to generate a report. Anyways, I've ran into a problem. The query is based on some controls in a form, but what I would like to do is that if a control was null then a field in the query should be assumed to be a wildcard for the criteria, otherwise the data in the control should be used in the criteria of the query. Does anyone have any ideas if this could be done?
Cheers,
Ben
View 14 Replies
View Related
Feb 26, 2007
I have a sales invoice table that contains parts that start with *, for example *SPR362.
I need to select only those parts that start with the *, as this is the wildcard in queries how do i select those products that start with it without it being recognised as the wildcard and selecting all records?
The field name is simply: Part
:o
Many Thanks
View 4 Replies
View Related
Jan 9, 2014
I have built a search form to feed information to a query. The form uses combo boxes tied to table values, and all have wild cards built into them so if the user leaves the combo box they get all the records. I also have to text boxes representing start date and end date. I would like to allow the user to leave these blank and get all there as well. I have been looking through my one Access book, as well as searched all over the internet, but I cant seem to find the way to do this. My filter criteria for the text based combo boxes are like this:
Code:
Like "*" & [Forms]![ReportDesignF]![Company] & "*"
My filter criteria for the Start and End Dates looks like this:
Code:
Between [Forms]![ReportDesignF]![StartDate] And [Forms]![ReportDesignF]![EndDate]+#11:59:59 PM#
In this case of the user leaves the date values blank, the query returns nothing. I would like to return all dates if that is the case. I am assuming it is my lack of knowledge of wild cards and how they work with date values.
View 14 Replies
View Related
Jun 5, 2013
I am trying to replace a # character and all characters after in a text field.
U set up a Select query and used the following expression:
Expr1: Replace([Part Number],"[#]*","")
It doesn't change any of the records. Is this possible to do in Access 2007?
View 11 Replies
View Related
Dec 2, 2005
I have a form orders with a subform orderdetails where we can order more than one product. When the order is finished you save it with a save button where it will also automathically mark the products ordered as not available.
Now, this code works, the problem is that it only marks one product. how do you make it mark all the products that where ordered (in orderdetails - the subform)? :
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
'set values here!
'loop?
Dim stAvai As String
Dim strSetProd As String
stAvai = "= " & Me.OrderDSubform.Form!ProductIdctrl.Value & " "
strSetProd = "UPDATE Products " & _
"SET Products.[Avail]= True " & _
"WHERE Products.[ProductId]" & stAvai & " ;"
DoEvents
DoCmd.RunSQL strSetProd
View 12 Replies
View Related
Dec 29, 2005
Hi folks,
I've searched through the forums and found a little on tab controls, but haven't been able to figure out what I am trying to do.
I have a form with mutliple tabs, each of which contains a subform related to the form on the first tab.
When I am scrolling through the records, I might select the fourth or fifth tab to view that subform, and then, when I scroll to the next record (using the nav bar) I want to stay on that tab... but so far, my form always defaults back to the first tab.
Any suggestions on how I can keep the form open on the tab that has the focus would be a great help. Thanking all readers in advance....
Don
View 5 Replies
View Related
Jul 12, 2007
I'm using an Excel spreadsheet that is importing external data from an access database in which I've got a field where the name of a person checking materials out is entered. it is currently set up, and I cannot change it, as a free form field. So folks enter information in a variety of ways.
For example, Larry Martin might be entered as "Larry Martin" or "Martin, Larry" or "larry.martin@somewhere.com". I'm trying to run a query that would look in that field for any entry with the string I enter, such as "Martin."
I've tried setting the criteria like this:
Like "*" & [Which Last Name] & "*"
However, when I try and run the query I get a message telling me the system is expecting two parameters.
Does anyone have any idea what I'm doing wrong? I've been banging my head against this for awhile now and am thoroughly stumped! All assistance, as usual, is greatly appreciated!
View 1 Replies
View Related
May 21, 2015
How do I design a query to return a result in a wildcard format? So that I could enter a part of a name, and it returns all the names that include that part of name?
View 1 Replies
View Related
Aug 13, 2012
I am new to Access 2007. I have a list of companies of are constantly updated,deleted, and created which are listed on a table. I have a form with an unbound text box with a sumbit button that opens a new form with the information of the name of the company in the search box. Unfornately, if the name of the company is not perfect, the record is not found and the form opens a new record. I want search box tyo autill, or "wildcard" when I begin to input a name of a company. I tried a combo box but my boss does not like it. He wants a wildcard search.
View 1 Replies
View Related
May 22, 2014
I've got a bit of a problem with # mark when I want to search a number containing "#". The number is as follows: 33.#5hy4-1234When I insert a part of this number to a textbox eg. #5hy to search records containg it, it gives me no results (despite there are such in a database) I know that it is to do with this # mark. I have an sql query: (...) where sachnummer like '*" & variable & "*'
View 3 Replies
View Related
Jan 27, 2014
I am trying to add a quotation mark on the end of my textbox value using this code : =[BuildResolution] & " " "
It will not work because it thinks I am adding a string. Is there any way to do this? The value displayed in the textbox would look like 0.01" ....
View 3 Replies
View Related
Jun 15, 2014
I am attempting to manipulate the Format Property of a Textbox. As an example, entering in &" lbs" causes your text to end with " lbs".... only I am trying to add a " mark, for example saying something is 6" away...
How do you tell the format property to add this?
View 5 Replies
View Related
Jan 30, 2013
I have a form with an image embedded in it. I want to be able to click on the image and leave a "dot" or "mark" where i have clicked, allowing me to click in multiple places on the image and leave multiple "dots"
I am assuming i need to crate a new shape each time i click, how is this done?
View 3 Replies
View Related
Dec 21, 2005
Hello.
I'm using a filter that contain # as one of the characters that the field might contain.
I get some very inetersting results.
using
"select fld1
from tbl1
where fld1 not like 'D#%'
"
Lets' say that the values for fld1(text type) are :
Dodo
D# cc
The query above will return the 2 records, it is "egnoring" the filter.
How can I solve this problem?
Thanks a lot
Roy
View 1 Replies
View Related
Mar 13, 2007
In my forename field I have entries with just the initial. I would like my query to filter out anything less than 2 characters. Does anyone know the criteria format?
View 3 Replies
View Related
Nov 5, 2014
Is it possible to format a textbox such that a negative value doesn't show numerically but in some other form (like a cross or exclamation mark from the Wingdings font, for example?)
I have a couple of textboxes which take their values from a function. The function is designed to return a long integer value which should always be greater than or equal to zero (the function counts the number of outstanding e-mails in a given Outlook folder, hence it should always be zero or higher)
However, as part of my error handling, if the function can't connect to the Outlook folder for whatever reason (for example, if the user does not have the appropriate permissions, or they do not have it mapped etc.), then it returns -1 (so I have some sort of value to identify a fail)
So currently, if such an error occurs, my textbox(es) will show -1 (and I can use conditional formatting to highlight this)
But it would be nice if it showed an "X" or "!" instead, and only showed the numerical value for 0 or positive. Is this possible?
View 14 Replies
View Related
Nov 5, 2012
How to get the last character of the string in query?
I have a table name PlateNo and I want to get the last character for registration purposes.
Ex. ZMD-123 - I want to get the number three(3) and if its possible every time the user types the last digit in criteria it will show all plate number ending in the entered number.
View 5 Replies
View Related
Dec 1, 2006
I am wanting to filter data in a table that only begins with an alpha character.
Ex. 233333
23444
03226
AAV233
Thus my result should only show the last character above "AAV233"
Please help. Thanks in advance.
View 2 Replies
View Related
Sep 19, 2014
The following is a simplified version of a puzzle I'm faced with, but if I can solve the simplified version I'll be able to solve the real thing.
Take the following column:
MyField
1-2A-B
YZ-A6
53-75-XC
How within a query can I replace the hyphens with spaces but only where they appear between two numbers? So this is the result I'm after:
MyField
1 2A-B
YZ-A6
53 75-XC
(note that the letters and numbers could be any values in any positions.)
View 3 Replies
View Related
Jul 12, 2005
Hello all,
I have always been wondering why this happens, and now I have a problem with it.
When I export a Table/Query from Access to Excel (be it with Right CLick -> Export...or TransferSpreadsheet) there is an apostrophe character (') appended to the front of some/each cell in Excel. You cannot see it immediately, but when you click on the cell, there is this character. WHY? Does anyone else have experience in this? :confused:
Thanks in advance.
View 3 Replies
View Related
Mar 4, 2015
Here is what I am trying to do. I have a query with 2 fields. "Time In" & "Time Out". What I would like to happen is this. Whenever a character, let's say a "t", is entered into that field I would like the current time to populate that field. Right now we are actually typing in the time. I have the fields set up as DateTime fields currently.
View 10 Replies
View Related
May 15, 2006
i've try and no luck... using Like "* *"
i'm tryin to create one that if i search for like let say "brisbane" it would show the results of the complete spelling, but let say if i was to just type "b" or "bris" it would show u a list of "B" towns or matching words of "bris".
any assit would be great
View 1 Replies
View Related