Excel If On Query

Dec 3, 2007

on my query there's a colunm which contain based on two other column. so is it posible using if function like on excel or i have to use module to do it?
i've read iif function but still dont understand.

what i need to do is;
if column A contain 1 and column B contain 2A, column C will be filled with "so close".
if column A contain 3 and column B contain 2B, column C will be filled with "near".
and so on.

How can i implement that?
thanks

View Replies


ADVERTISEMENT

Access Query With Links To Excel / Export To XML And Back Into Excel

Apr 25, 2013

I am using Excel and Access 2010.

I have an excel spreadsheet with 8 tabs. They are all in the same format and column order. They are employees grouped by region. My ultimate goal is to merge all of these onto one excel tab, relatively instantly. I created a master tab and tried doing array formulas and Vlookups, it worked but my spreadsheet was way too slow.

My solution? Import and link them to an Access database, step complete. Create an XML export then import into Excel.

My problem? The only way to update the excel tab with the combined tabs is to save the excel file after changes, go back into Access, re-export to XML, then go back into excel and refresh the data.

My questions, is there any way to automate this process to the point that I can change excel, save, then hit refresh on my excel tab with the XML import to auto-update?

View 7 Replies View Related

Queries :: Export Query To Excel Then Delete Query Data From Table

Nov 20, 2013

I am wondering if there is a quicker way to export a query to excel then have the data in that query removed from the original table. (effectively cutting the data from the table and exporting to excel)

I understand that this can be done by exporting the query to excel then running the same query as a delete query to remove the data but I just wondered if this is the most efficient way.

I have experience of VB in excel but currently only use the basic macro builder in Access though if Access VB is more efficient I can easily learn.

View 5 Replies View Related

Excel If On Query

Dec 3, 2007

on my query there's a colunm which contain based on two other column. so is it posible using if function like on excel or i have to use module to do it?
i've read iif function but still dont understand.

what i need to do is;
if column A contain 1 and column B contain 2A, column C will be filled with "so close".
if column A contain 3 and column B contain 2B, column C will be filled with "near".
and so on.

How can i implement that?
thanks

View 1 Replies View Related

Query Via Excel

Apr 3, 2008

I have a query in Access which selects records with a date value in between 2 dates from a field called 'Period', e.g. 01 Jan 07 to 01 Apr 07 (>="01 Jan 07" AND <="01 Apr 07") which returns all the records I would expect, i.e all records between 01 Jan 07 and 01 Apr 07.

The 'Period' data/values are put together using 2 fields
strMonth e.g. Jan, Feb, Mar, etc
strYear e.g. 2006, 2007, etc
and built using the expressionPeriod: CDate("01 " & Trim([tblBookIt]![strMonth]) & " " & [tblBookIt]![strYear]) returning a valid date value for each record returned in the query

When I run this query using 'Get External Data' in Excel using the Query Wizard, the Filter Data option doesn't give me all the period values that are on the table. I have 2 years of data in the table, Jan 06 to Feb 08, each record having a Month (strMonth) and Year (strYear) field but running the query in Excel only gives me the option to select Mar 07 to Feb 08.

I am struggling to work out why when using Excel to run the query it seems to be ignoring all data with a date value prior to 01 Mar 07. I know this query is very specefic to my database which you don't have access to, but am hoping someone is aware of what I may be doing wrong.


Thanks

View 1 Replies View Related

Link A Query With Excel

Aug 15, 2006

Please would someone be able to advise me how I could link an Access Query to an Excel spreadsheet. Also, is it possible for the Excel spreadsheet to be 'updated' automatically when the data in the Access Query is updated ?

Many Thanks

Richard

View 1 Replies View Related

Query For Exporting To Excel

Oct 20, 2006

I've been searching for a good solution for this and can't find it. Hopefully something like this is possible.

I need to produce a report in excel from my database that needs to include information from 5 different tables. The relationship between two of these tables is a many-to-many relationship connected by a junction table. (I hope that is the right terminology)

My report needs to be in a certain format and needs to include all fields in the same order for every record.

The problem arises because of the many-to-many relationship. I have a tblOrder and a tblAgent linked by the junction table tblAgentOrder. For every order there can between 1 and four different agents associated with the order which are stored in the junction table. In addition these agents will be of different types 1-4.

Ex: One order could have an agent of type 1 and an agent of type 4. While another order may only have one agent of type 2.

I need the query to give me the result of OrderID, DateOpened, AgentType1, AgentType2, AgentType3, AgentType4. Regardless of if the order actually had an AgentType3 or 4 associated with it. In this case the fields would be blank.

Right now I'm getting:
OrderID, DateOpened, AgentType1
OrderID, DateOpened, AgentType2

I hope this makes sense, but let me know if I need to clarify anything.

Thanks in advance.

View 2 Replies View Related

Exporting A Query To Excel

Nov 7, 2006

I have a form that allows users to specify the information they want to be displayed on a subform. I have used the below code (simpilified for example purposes) to create the SQL string and sent it to the subform for display. I would like to have an export to excel button to export the recordSource to a spredsheet. is this possible?


Me.frmsubClients.Form.RecordSource = "SELECT DISTINCT New_Client_Table.Account_Number" & BuildFilter

Thank you in advance.

View 1 Replies View Related

Exporting A Query To Excel

Dec 4, 2006

Hi all, when exporting a query to Excel is it possible to perform page set up controls to the Excel sheet? Or will I need to create VBA page set up controls with in a Set objXL = New Excel.Application??:confused: :confused: :confused:

View 1 Replies View Related

Export Query TO Excel

Oct 9, 2007

I have a query in access 2002 named "FMC DETAIL / MEMBER" when i export to excel 2002 with named "FMC DETAIL_member" the export says "Path is invalid"

My main point is that "/" should be replace with "_" in file name automatically.
In access 97 query named "FMC DETAIL / MEMBER" when export to excel the "/" is renamed to "_" automatically.

Any Help would be appreciated.........

View 1 Replies View Related

Another Access Query To Excel

Nov 8, 2007

I have the attached DB.
On the form I have a button which will send the results of the Access Query2 to an Excel spreadsheet-OK, this works and no problem.

But what I would like to do is push the button and it will send the results of the Access Query2 to an existing spreadsheet called caseloadmgt.xls which is located on my desktop - C:Documents and SettingsJim.BlackDesktopcaseloadmgt.xls
And the next time I push the button to run the query again I want the new data to start 2 cells below the ending of the first query results in the spreadsheet.

I have tried to follow all the examples I could find and I guess I just don’t know enough about this to make it work. What I need is someone to correct/ or change my code and put the new/corrected code in the DB where it should go

View 1 Replies View Related

Export A Query To Excel

Jan 28, 2008

Hi! I know queries can be exported to excel by the option "File > Export".

The fact is that I'm using "order by" options and some functions like "Month", and "Export" options appears disabled, is there a way to export this query to Excel? :confused:

View 2 Replies View Related

Excel Linked To Query?

Nov 25, 2004

Just wondering, is it possible to have an excel file, which is a export data from an Access db query, and whenever I open this excel file, it'll automaticallly run the query and get the most updated data? If so, What do I need to do in order to link the excel file to the query?

Thank you. Any help is appreciated.

View 3 Replies View Related

Export Query To Excel

Dec 2, 2004

Hi there,

I have a button on a form and when I press it I would like this to happen:
Some code will be run that makes a copy of an templatefile (Excel), puts the values that comes from my query into the document and the saves it with a name that comes from two textboxes. I would also like to be able to put in some other text in the document, like two dates that I have on my form. Does anyone know how to do this ???

View 14 Replies View Related

Query Exports To Excel

Nov 17, 2011

I have an application at a client site which is split into two mdb files, a front end (forms, queries, etc.) and a backend (tables, data only).I have a query involving multiple tables, which creates an Excel Spreadsheet. Sometime after installing it at client site, it no longer works because the entire contents of the query itself are wiped out -- totally empty. When I open up the query in design mode, it is empty -- no tables, no columns, no select blank, empty.

View 9 Replies View Related

Excel Querying Access Using MS Query

Jun 21, 2005

Hi folks!

I've got my application working wonderfully and now have set up some reports in Excel. People want to be able to manipulate the data and I figured this was easiest...the users don't know how to create their own report within Access but are Excel literate.

My workbook has two queries (setup using Microsoft Query) back to the database...the data is returned to the workbook and then sorted within the workbook using Excel formulas.

This works fine all data is present and correct and the results are accurate.

HERE'S THE PROBLEM

My database keeps corrupting. The LDB file isn't being deleted after the last person exits the database. I downloaded the LDBUTILS from Microsoft and found that when a person accesses the database via the Excel workbooks the session is left in a suspect state and this is causing the corruption.

I know it's not a server permissions error because I created the folder and am the owner of the file. I have full control of the files and folder on that part of the server yet my own PC frequently leaves the database in a suspect state.

Does anybody know what I can do to stop this? Is there a piece of code I can add so that when the workbook is closed the database session is also ended cleanly?

Thank you in advance

Jo

View 2 Replies View Related

Using Excel Data To Run Access Query

Aug 4, 2005

In Excel I have a sheet with about 3000 rows. Each row has an id. I need to retrieve a field from an Access database for each id in the Excel file.

I know how to query the Access database from Excel, but I don't know how to set the query to use the id's in the Excel sheet instead of an Access table.

Any help would be appreciated. Thanks.

View 1 Replies View Related

Query Output To Excel Not Working

Aug 30, 2005

Windows XP Pro/Office 2000

I was able to output to excel before fine, now all of a sudden I cannot. I keep getting a message when I go Tools>Office Links>Analyze with MS Excel:

"Cannot access "xxxvac_Inv_DBQuery.xls"

It's wierd. It won't output the data, but it still creates the spreadsheet file.

Any Idea's?

Thanks to all in advance, your help is greatly appreciated! :(

View 1 Replies View Related

Export Access Query To Excel

Dec 31, 2005

Folks,

I have a form with combo box (cboProjForRptSeltn ) and two command buttons. The combo box is filled with name of the reports. The combo box has two columns, column 1 is the name of the report and column 2 is the bound column which also is the link field (primary key) to limit the records.

When the user selects an item from cbo box and click the "Preview Risk Table" command button it will open a report in preview mode. The report's "Record Source" property is set to a UNION query (qryRprtRskTbl) which pull the records from several tables. The report's "Filter" property is set to the following criteria:
“qryRprtRskTbl.P.intProjectId=Forms!frmReportSelec tionBlrR1!cboProjForRptSeltn”

The above criteria is nothing but filter based on the value of the cbo box.

The click event procedure is as follows:
Private Sub cmdPreviewRprt_Click()
Dim strDocName As String
strDocName = "rptRskTblProjectWise"
DoCmd.OpenReport strDocName, acPreview, "qryRprtRskTblFilter_r1"
End Sub
"qryRprtRskTblFilter_r1" is another query out of the UNION query I mentioned above (qryRprtRskTbl). qryRprtRskTblFilter_r1 is pulling all the records from qryRprtRskTbl which meets the projectID field selected in cbo box, which is also the same as the "Filter" property value of the report as indicated above.

Everything works fine with cbo box and "Preview Risk Table" command button. It just pull all the records for the project selected under cbo box and display it as report in preview mode. Looks great!!

Here's my problem. I wanted to export the same report that was previewed by the user to Excel. For this I am using, another command button called “Export to Excel”. The click event of this procedure is as shown below:

Private Sub cmdExportToExcel_Click()
On Error Resume Next
Dim xlApp As Excel.Application
Dim xlSheet As Excel.Worksheet
Dim xlWorkbook As Excel.Workbook

Dim acQuery As QueryDef
Dim objRST As Recordset
Dim strQueryName As String
Dim strSearch As String
'Dim strSQL As String

'strSearch = Me![cboProjForRptSeltn]

strQueryName = "qryRprtRskTblFilter_r1"
'strQueryName = "qryEffcyAllProjtsForRprt"

Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlWorkbook = xlApp.Workbooks.Add
Set objRST = Application.CurrentDb.OpenRecordset(strQueryName)


'Loop through the fileds collection and make each field name a column heading in Excel
Set xlSheet = xlWorkbook.Sheets(1)
For lvlColumn = 0 To objRST.Fields.Count - 1
xlSheet.Cells(1, lvlColumn + 1).Value = objRST.Fields(lvlColumn).Name
Next
'Change the font to bold for header row
xlSheet.Range(xlSheet.Cells(1, 1), xlSheet.Cells(1, objRST.Fields.Count)).Font.Bold = True

' I have some codes here for formatting Excel cells …

'Send data from Recordset out to Excel
With xlSheet
.Range("A2").CopyFromRecordset objRST
.Name = Left(strQueryName, 31)
End With

Set xlSheet = Nothing
Set xlWorkbook = Nothing
Set xlApp = Nothing

End Sub

When I click the command button, it loads an instance of Excel and adds a workbook under the query name "qryRprtRskTblFilter_r1", but no data.

If I use another query say, "qryEffcyAllProjtsForRprt", which has no connection to cbo box value then it is cool, exports all the data to Excel without any problem.

I guess, you folks understand what I am trying to achieve here. Basically, I wanted to give the user some flexibility, either they can view the data as Access report or Export to Excel with same formatting feature and add more later if they want after exporting, as they see on Access report preview.

I have attached some of the query files I have described here. May be I can clarify more down the road, if necessary.

My bottom line question is: why the “qryRprtRskTblFilter_r1” query runs perfectly on Access reports but not when I want to run to export to Excel?

I don’t want to use the TransferSpreadsheet or outputTo method of docmd object, because I wanted to do some formatting before I export to excel.

Any help is greatly appreciated.

Thanks

ShanVel

View 7 Replies View Related

Excel Formula To Access Query

Jan 11, 2006

Hi does any body no the access syntax to create this excel formula

=POWER(SQRT(L5/10)*47.1,2)/3769.9

Into access

Thanks

John

View 2 Replies View Related

Aggregate Query (Export To Excel)

Jan 19, 2007

Hi Everyone,

I am working on a Sales Analysis db, which pulls from:

tSales - Sales Figures (40k records)
tBuildUnit - Bom Build Units (8k records - one per product)
tBom - Bills of Material - All Components (71k records)
tUom - Units of Measure for Products (80k records - 10 per product)

It is quite basic in theory, it looks at a product sold, goes to tBom to get the cost of the raw materials.

I have a query that sums the components by their group, distinguishing between material and labour cost by the component group (cGrp) which is 'WORK' for labour and <>"WORK for materials. I can then sum the cost of the materials for a given product.

Anyway to cut to the issue in hand.

I export from our system (LM4 on btrieve on novell 3.2) into CSVs then manipulate those


And basically i want to have:

Cust______Sale04__Sale05__Sale06__Mat04__Mat05__Ma t06
Genesis 400 350 420 230 190 250
Exodus 0 100 0 0 60 0
Revelation 200 300 140 200

we have 220 customers in this recordset. so i would like just 220 rows.


My data that i export shows every transaction (so i have 40k records)

So i used a aggregate query, grouping by customer account and summing the value, material, and labour fields, however this gives me each customer three times, one per year e.g.:

Cust______Sale04__Sale05__Sale06__Mat04__Mat05__Ma t06
Genesis 400 0 0 230 0 0
Genesis 0 350 0 0 190 0
Genesis 0 0 420 0 0 250

How do i get one what i describe above?

After the query runs i want to export to excel with:

DoCmd.OutputTo acOutputQuery, "qGrouping", acFormatXLS, "d:Output.xls", True


Thanks

Graham
(Carpenter by trade, now in construction acoustics and really shouldn't be doing anything with access!)

View 1 Replies View Related

Query To Output A CSV Or Excel Like File

Feb 13, 2007

Hi Guys,

I have 2 tables

tblXRFResults

ResultID
SampleName
Date
SampleDate
a few others not necessary in this

and tblXRFResultsConcentration

ResultID (many records linked to 1 record in tblXRFResults)
Concentration
CompoundName

What I need to set up is a query that will allow me to generate a report that will give an excel like format, with the column headings being the SampleName, followed by the CompoundName(s) from the other table and the "rows" will be corresponding sample name and concentrations.
I am sure this is pretty easy, but I am stumped!

Any help would be greatly appreciated.

View 6 Replies View Related

Running Query In Excel On Access

Aug 3, 2007

Am running a query in Excel on an access table that uses lookup columns. The query is returning in excel with the right data but is returning the lookup value number rather than the data stored inside. How can I return the actual data value rather than the lookup value number.

i.e I have a list of areas

NY
CT
WA

in a lookup column.

User selects CT so is lookup value 2. But I want excel query to return CT.

How can I do this?

thanks

View 2 Replies View Related

Transferring Query Data To Excel

Mar 28, 2008

Not sure how easy this one will be but here goes.

I currently have a database which collects details of event effecting our business and am using a simple query that displays events within a defined date range.

I have also set an excel sheet which on the main worksheet appears as a calender format for a particular month which is updated by data in the access query. At the moment I tranfer the query to excel and it appears as a new sheet which I then have to link to the master calender.

Is there any way when exporting to excel to tell access to send the data to a particular sheet and cell range and even more advanced tell it were to put certain dates information? i.e send 1st March info to cells A1 to A4, 2nd to A5 to A8 etc.

Hope someone has some ideas on this one - even being able to send all data a specific cell range would be useful

View 2 Replies View Related

Exporting A Query(report) To Excel

Mar 11, 2008

I am exporting queries to Excel using a Form with command buttons. The code for this effort follows:

Private Sub Command8_Click()

Dim reportName As String
Dim theFilePath As String


Select Case Me.Frame1.Value

Case 1
reportName = "qryPriorMnth"
Case 2
reportName = "qryNewRequests"
Case 3
reportName = "qryNoApprovals"

End Select

theFilePath = Me.txtFilePath.Value
theFilePath = theFilePath & reportName & "_" & Format(Date, "yyyy-mm-dd") & ".xls"

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, reportName, theFilePath, True

MsgBox "Done."

End Sub

The code works great, however, I will be making this available to several users who will use access from differenct PCs. In order for them to get the data passed to their respective desktops, they would have to change the Me.txtfilePath.Value in the properties manaually. This is currently in the Row.Source for an unbound text box. I would prefer them not messing with that. The current value is
="C:Documents and Settings’User_ID’Desktop"
where the User_ID (varies from user to user) would need to be changed. Can this be done with a variable setting that would prompt the user for their User_ID and then execute to the appropriate desk top. I am a VBA novice and would appreciate any help at all.

Thanks
Alan

View 2 Replies View Related

Trying To Doa Query With Access Using And Excel File

Apr 4, 2007

Please Help i have been trying to figure this out for some time now and I am really stuck. I need to maniuplate data that is in an excel spreadsheet basically seperating out certain data and putting that information into seperate columns an example of what i am trying to do is this.
in excel I have a numbers 117.865.65, 117.865.79, 117.865.60 associated with the Name "Cell Phone in Blue, Cell Phone in Red and Cell Phone in Green " what I am trying to get Access to do it take the part of the number that they all have in comon and put that into a column, then take each of the different numbers and put that into a column, and then put the Names of each item and put that into a seperate column. like this:
117.865 Cell Phone
117.865 .65 Cell Phone in Blue
117.865 .79 Cell Phone in Red
117.865 .60 Cell Phone in Green

anyone that know how i can get access to do this your help woudl be greatly appreciated.

View 1 Replies View Related







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