Queries :: Need Function To Reverse LName / FName
Aug 21, 2014
I have a table with data that is imported from another application. The employee name is showing up as LName, FName. What function can I use to make these FName LName with no comma? I know I may have to do a two step to separate the two then concatanate but not sure how to do it.
UTA: I figured out LName: Trim(Left([ApprovedByFullName],InStr([ApprovedByFullName],",")-1)) to pull the last name minus the comma. How do I pull the first name?
View Replies
ADVERTISEMENT
Dec 16, 2005
I want to split the name field in Access database to 3 different columns Lname, Firstname and Middle name/initial.
Below is some sample records with Lname,First name and Middle Initial/name.
PETERS M.D., WILLIAM A. III
BOUCEK, ROBERT J. JR.
MANSURD, ABDULRAZZAK
BADDIGAM, KRISHNAMOHAN R.
ABD EL AZIZ,AHMAD MOHAMAD
MEMON,MOHAMMED SALEEM
BREN-FIELDING,ALEXANDRIA
ABD EL AZIZ, AHMAD MOHAMAD
VAN GENUGTEN, RENATE E.
CHESNUT, CHARLES HAILE IV
LAW, MICHAEL W. Y.
NGUYEN, DAO VAN NGHIEM
STA. MARIA GANAL, JULIUS R
CAWAGAS, LAURITO JR LABIO
Please let me know.
Thank you.
Anish
View 14 Replies
View Related
Nov 23, 2014
How do I query from this table:
ORIGINAL_table
FName | END_Date|
--------|---------------|
John| Oct 09, 2014|
John| Oct 15, 2014|
John| Oct 25, 2014|
Mike| Dec 10, 2014|
Mike| Dec 15, 2014|
Mike| Dec 20, 2014|
Mike| Dec 25, 2014|
Jimm| Dec 10, 2014|
Jimm| Dec 15, 2014|
Jimm| Dec 20, 2014|
Alex| Dec 01, 2014|
Alex| Dec 05, 2014|
Alex| Dec 10, 2014|
Thom| Nov 10, 2014|
Thom| Oct 10, 2014|
Thom| Aug 10, 2014|
The output will be:
FName | END_Date|
----------|---------------|
John| Oct 25, 2014|
Mike| Dec 25, 2014|
Jimm| Dec 20, 2014|
Alex| Dec 10, 2014|
Thom| Nov 10, 2014|
The query table(output) will just have to be latest date("END_Date") per "FName"
View 1 Replies
View Related
Oct 14, 2005
I have a one-to-many-relationship set up. Now I need to jam each related many into one field in a new table to make it like a list. Is there an easy way to do this?
View 4 Replies
View Related
Sep 21, 2005
Hi
Im working on an Access Database at work. It records the training undertaken by NHS clinical, managerial and admin staff in Brighton. It is used also to generate invoices etc.
I have a better knowledge of access than anyone else here (outside of IT department obviously) so I have been asked to get rid of some glitches and add some functions.
A big hurdle I have found is this:
I can very easily for example, add a command button to open a form, run a query etc, using the wizard.
However I am trying to ascertain what some particular command buttons actually DO. Am I right in thinking there is no way of "reverse engineering" using the Wizard or similar? Because the only thing I can find is Properties > Event > Onclick [eventprocedure] and if you click on build you just get visual basic which I sadly dont understand.
Im not sure if ive made any sense at all. In essence, im saying that making stuff seems easy, but working backwards and dissecting it seems to only result in VB code.
Is there a way around this?
Gazz
View 1 Replies
View Related
Jul 15, 2006
Is there a way to reformat so that the line that is the next line to be entered is at the top instead of the bottom >> I hope that is clear
Also when i use the scroll bar at the bottom at the very end to the right it show grey in the background is there a way to limit it so only what is used is showing
Thx STeve
View 5 Replies
View Related
Sep 14, 2005
I split a database and created a backend but now I dont need it and I accidentally deleted the backend while I was updating the file folder and it was on the network so it's gone for good.
Is there a way to reverse splitting a database so it no longer requires the back end?
View 1 Replies
View Related
Nov 8, 2005
i have a lists of emails+domain names eg camae@yahoo.com. im trying to sort them in reverse order but "reverse" seems not working in access. anyone knows how to do them or i was thinking of sorting the list begin with the domain names (which is after the '@') but i dont know how. ive tried using "like "*@[a-d]" but the result displayed is not sorted in alphabetic order. sorry im a beginner. thanks in advance
View 8 Replies
View Related
Feb 8, 2006
Hi.
I've downloaded Stephen Leban's nifty calendar and have it working beautifully to enter in dates and ranges of dates to a fishing schedule table (this is a fishing regulations database). (thanks to RuralGuy for posting the link to this, and other calendars, on another thread)
I have a form for entering some parameters to narrow the results of a select query that shows the start and end dates for individual blocks of consecutive time for each scheduled fishery. (Some fisheries might be scheduled to occur every thursday and friday for a couple of months, or other hard-to-predict ranges of time.)
What I would like to do next is to click a button on the form to make the calendar appear with all the dates where fishing is scheduled to occur (from the query results) be highlighted, or circled (or something equivalent).
My vba 'skills' are not up to tinkering with his class module without some serious assistance. Has anyone tried something similar to this with his calendar? Is it even possible?
I have seen other calendars that do something similar (though I'm still in over my head trying to figure out the modules) but I'd really like to keep with Stephen Leban's calendar since it allows much more felxibility in displaying over various time intervals.
I would greatly appreciate any assistance. Thanks.
View 1 Replies
View Related
Jun 9, 2006
I have two tables A and B. There is a 1 to many relationship between A and B. Table A's data is controlled by FormA, Table B's data is controlled by FormB which is a subform on FormA. I already have a combo box for navigation on FormA, however I would also like to be able to have a combo box on FormB (FormA's subform) for navigation, so that when I choose an record from the subforms (FormB) combo box, FormA then jumps to the 1 record from FormA that contains the related record choosen in the SubFormB's combo box (along with the subforms choosen record on the subform) .
Kindalike the combo box on FormA, except it's a 'reverse lookup' if that makes sense. Is this at all possible, does this even make sense? :confused:
_______________
HOLY CRAP BATMAN!!!
View 2 Replies
View Related
Mar 22, 2006
Hi everyone,
I have learnt so much here and I could do with some advise from all of you.
Recently I have developed a software using MS Access and I am in the process of getting Copyrights, Trademark rights for my software.
The software is to be distributed via the internet for personal use. However, I have been having serious concerns about people trying to reverse engineer the code and selling it under another name.
The last thing I would want is someone else making money off pawning this. Not only does it bring bad credibility but can really dent the business end for me.
Can anyone please suggest any way that I can block anybody from reverse engineering the code.
Also how can I make my program user specific and tamper proof??
Thanks and appreciate your help.
View 6 Replies
View Related
Aug 3, 2015
I'm using I have a secondary control being populated by an entry from another control. I was able to find the code I needed to do this using a combo box here in this forum.
me.txtDependent=me.cboPrimary.column(#)
(specifics changed to protect my company's paranoid view of privacy)
the code itself was showing up in the secondary control instead of any value. I found though that moving the code from the On Change event for the primary control to the On Current event for the form itself everything is working beautifully.
However, I have a different task now that I need to be able to accomplish with the same two tables but in the opposite direction. I suspect that I'm going to need to create a second set of controls and maybe even a second relationship or table to do this. To use a set of specifics that I think will get this point across, if I had a master table which includes a field for "City" and a secondary table, CityState, which contains both "City" and "State", and two controls, a combo box cboCityState to look up the specific City and a text box, txtState to display the State, putting the following code in the City combo box's On Change event populates a text box with the State when the specific City is selected, or putting it in the form's On Current event will be sure that State shows up in all the copies of a form when the form is used in a search and the City is not changed :
me.txtState=me.cboCityState.column(2)
What I need to do now is to set up a control which allows me to type in the State and have the results show all records that include that State.
I'm using this in a Filter by Form environment. I know the objections to this method and the benefits to creating a dedicated search form, but this method appears to be working well in all other ways for us for now. I have several situations within this form where I have one control showing up at the initial load of the form and at the beginning of the filtering process, allowing selection of multiple values from a long list of values in a list box, for instance, (using the On Filter event) and other controls showing up as a result of the filtering process, to display the selected criteria only, for instance (using the On Apply Filter event), so I'm aware of how to make this work if that's required. I'm thinking I may need to create a second control, something like txtStateInput, to accept the State search criteria and another, something like txtCityResults, to show the cities that are part of the resultant records.
View 5 Replies
View Related
Jun 13, 2013
One of my clients has asked me to look at building a way to check if the email addresses they are capturing in my CRM are valid. He want's to go beyond checking for no "@" etc.
From what I've seen, it looks like a reverse DNS check (might be totally wrong) is the way to go. IE: check if the email is valid. I've see a few tools online that can do it one by one (which I could parse to if I had to) - but ideally I'd like to be able to run this from a VBA script.
View 9 Replies
View Related
May 17, 2006
I'm looking for someone that knows how to link check boxes on a form to the "show" check-box in a query. Basically, all I'm trying to do is have the end-user tell the query which fields to show in the output. If checkbox "A" is checked on a form prior to kicking off the query, I'd like field "A" to show in the query output...and so on.
Thanks, Paul
View 3 Replies
View Related
Oct 11, 2013
I have a query driving a report that fills in the on time or late based on comparing the release date to the production due date. The code works except for if we haven't released it yet and the release date is void. I need it to then check versus today's date and then populate the late/on time. But I need this to take a back seat to if both fields are populated. Here is the code I am currently using and I have attached a screen shot of the query with the 2 boxes highlighted in red.
On Time / Late Eng: IIf([Released to Prod]<=[Prod Due Date],"On Time",IIf([Released to Prod]>[Prod Due Date],"Late",""))
View 7 Replies
View Related
Jul 21, 2015
How do I use the Max() function to get only one number. And also what do I put in the parentheses?
View 14 Replies
View Related
Feb 5, 2014
I am using a function to set criteria in a an query. It reads the selected values from a combobox on a form and passes the appropriate value into the sql criteria.
E.g., the sql criteria is set to : like fnCountry()
And the function fnCountry() is something like;
If SelectedCountry = "All" Then
fnCountry = "*"
else fnCountry = SelectedCountry
end if
This works fine for a single selection (SelectedCountry = Africa) but doesn't work if I try to combine multiple selections into the criteria string.
E.g. SelectedCountry = Africa Or Italy
So the criteria would need to be
Like "Africa" Or like "Italy"
How else can i build this criteria with multiple values?
View 3 Replies
View Related
Mar 13, 2007
Hi
I have a table which has information the count of students in classrooms around the university and I need to summarize the table by Faculty. Therefore, all I want to do is a count of students for each faculty i.e. Art and Design, Business and Law etc.
The query i put together is: SELECT Count([tbl_Audited Classroom for Week 02].Faculty) AS CountOfFaculty
FROM [tbl_Audited Classroom for Week 02]
HAVING (((Count([tbl_Audited Classroom for Week 02].Faculty))="BAL"));
So when I run the query I get the error message 'Data Type mismatch in criteria expression'. The Faculty field is a text field, so I don't know if that would make a difference.
Can you please help?
thanks
View 5 Replies
View Related
Jan 28, 2014
I am trying to , create a field using the IIf function that will display a $250 bonus for agents every time they sell a car for at least $20,000. Otherwise, the function will return a 0. Name the field Bonus. I put in Bonus: IIf(SalePrice >= "20,000" Then + "250",True, 0) and it is saying that I have an improper syntax.
View 2 Replies
View Related
Apr 3, 2015
I have a table that holds the dates of various approvals for documents.
Approval DatesDocumentID
ApproverA_DateApproved
ApproverB_DateApproved
ApproverC_DateApproved
LastUpdated
In a query, I'd like there to be a column with the date of the most recent approval (max date) for each document. Using the following formula in the Expression Builder gives me the error below.
Code:
Name: Max( [Projects]![ApproverA_DateApproved],[Projects]![ApproverB_DateApproved],[Projects]![ApproverC_DateApproved])
"The expression you entered has a function containing the wrong number of arguments"
How can I get the most recent date a document was approved by any approver?
BTW - I initially thought I could just use the date the record was last updated. However, sometimes people remove their approval. This causes the LastUpdated date to be wrong (for this purpose), since it then reflects the date they removed their approval, not the most recent date that someone gave it.
View 3 Replies
View Related
Aug 1, 2014
How do I use the DateValue function with a query that pulls data between dates? Here is my code below. I'm getting an error that my expression is too complex or incorrect.
Code:
SELECT IIf([tblAUCodes].[BusinessLine] Like '*CMES*',"CMES",IIf([tblAUCodes].[BusinessLine] Like '*HOUS*',"CMES",IIf([tblAUCodes].[BusinessLine] Like 'CTO',"CTO",IIf([tblAUCodes].[BusinessLine] Like 'Shareowner*',"WFSS","SPS")))) AS LOB, Count(tblPACSTemplate.temID) AS CountOftemID, tblPACSTemplate.Type, DateValue([ApprovedDate]) AS ApproveDate
[Code] ....
View 8 Replies
View Related
Jul 5, 2013
I am currently designing a dashboard for my team which works on projects, I have a main table which has main fields which i use for my dashboard
Project Type,Project ID (Primary Key), Submitted by, Project Start date, Project end date, Status
The tricky part is that the raw data has projects which got started couple of years back some got closed in the previous fiscal year but some are still being worked upon..I was able to put in a where clause to only display projects whose close dates either have null value ( projects which are still being worked) and where the close dates are >= 1/1/2013. My Dashboard needs to have the below fields
Project Type, Count of Projects, Count of Closed Projects, Average days to complete, Count of Active Projects & Average Active days
I was able to get it correct except the last field Average Active days as it is displaying Average no's even against the project type which doesn't have any active projects or where the active project count is zero.
SELECT TblWO.[Operational* Categorization Tier 2], Count([TblWO]![Operational* Categorization Tier 2]) AS [Count], Avg([TblWO]![SLA in Days]) AS [Internal SLO in Days], Count([TblWO]![Closedate]) AS [No Closed Projects], Round(Avg([TblWO]![Closedate]-[TblWO]![Work Order Submit Date Time]),2) AS [Avg Close Days], [Count]-[No Closed Projects] AS [No Active Projects], Round(Avg(Date()-[TblWO]![Work Order Submit Date Time]),2) AS [Active Avg Days]
FROM TblWO
WHERE ((([TblWO]![Closedate]) Is Null Or ([TblWO]![Closedate])>=#10/1/2012#) AND (([TblWO]![Status])<>"Cancelled" And ([TblWO]![Status])<>"Rejected"))
GROUP BY TblWO.[Operational* Categorization Tier 2]
HAVING (((TblWO.[Operational* Categorization Tier 2])<>" "));
View 3 Replies
View Related
Feb 13, 2015
I have a query that I'm working on through Access 2010's design view. I'd like to add a criteria to the query where it only shows results with the employee name column matching a global variable I created that stores the name of the currently logged in employee.
Here's my vba code that declares the global variable and the public function i'm trying to pass as criteria in the query:
Global gbl_loginName As String
Public Function returnName() As String
If IsNull(gbl_loginName) Then
returnName = "test" ' dummy account created for development only
Else
returnName = gbl_loginName
End If
End Function
and here's the SQL code from Access's design view:
SELECT [Entry of Hours].WC, [Entry of Hours].[Employee Name],
[Entry of Hours].[Set Up Time], [Entry of Hours].[Run time],
[Entry of Hours].[Traveler Number], [Entry of Hours].[Entry Date],
[Entry of Hours].[Quantity Finished], [Entry of Hours].Notes, [Entry of Hours].WPS,
[Code] ....
when I try running the query, however, I get this error:
'returnName' is not a recognized built-in function name
Is there a problem with using public functions in Access' design view?
View 10 Replies
View Related
Dec 27, 2013
UMMonth1: Choose([Enter Qtr],[OperationsAuditData]![1],[OperationsAuditData]![4],[OperationsAuditData]![7],[OperationsAuditData]![10]).But I keep getting an error message "You tried to execute a query that does not include
"UMMonth1: Choose([Enter Qtr],[OperationsAuditData]![1],
[OperationsAuditData]![4],[OperationsAuditData]![7],[OperationsAuditData]![10])' as part of an aggregate function."
View 2 Replies
View Related
Apr 8, 2014
I'm having trouble using the "group by" function in my query. The option in design view is not showing up and I'm not able to figure out what I'm doing wrong. What is there in design view is Field, Table, Sort, Show, Criteria, Or. I seem to be missing the "Totals" option.
View 2 Replies
View Related
Apr 26, 2013
I'm trying to build (a rather simple) totals-query, but the "last" function doesn't give me the right values.Suppose I have a database where the amount of products that were sold are stored per month. It's possible that some products are not sold in some months. Now, I want the LAST REAL VALUE (= amount) for each product, no matter what month :
prod1 = 4
prod2 = 3
prod3 = 3
How can I do that, because the LAST-function gives me
prod1 = (empty)
prod2 = 3
prod3 = (empty)
View 6 Replies
View Related