Can You Use IIF In MSQuery

Apr 13, 2009

Is it possible to create a new field in MS Query which uses an IF / IIF statement to determine it's value?

I am querying an Excel file/table, and have a field called 'Mo Nm' (month name) which stores the name of the month of a sales record, with the sales value stored in 'Sale Value'.

I'm trying to create 12 new fields in my query output to report the total sales by customer by month in a single record, rather than 1 record per month, and having to then do a Pivot Table on the result.

MSQuery is using a table called Data$ (the XL file has a sheet called 'Data', which stores the XL list being queried).

View 9 Replies


ADVERTISEMENT

Grouping And Then Summing In Either Msquery Or Back After The Data Has Been Extracted From Msquery

Nov 19, 2009

I need grouping and then summing in either msquery or back in excel after the data has been extracted from msquery.

I have external data that i have interogated in msquery, and I would like to to sum the amount column if possible.
I have two fields, first field = account number
2nd field = amount due

the first field could contain 5 sets of the same account number, but with different amounts in the Amount Due column. I would like to sum the amounts due for each of the account numbers in one column.

If i cannot do this in msquery, how do i then go about doing it back in excel. I know i can use subtotals, but then when the data updates from the external data source.

View 2 Replies View Related

Change MSQuery References

Jan 13, 2009

I have a spreadsheet that queries another spreadsheet, using MSQuery. The query is of a named range on another workbook. What I am trying to do is change the workbook reference, to another similar workbook, with the same range name. MSQuery is not easily letting me do this. I figured there was a way to simply change the file that the created table (in MSQuery) is using. There doesn't seem to be a way to do this.

The named range is "data." This is what the SQL view looks like: ...

View 9 Replies View Related

Date Format In Msquery

Jul 11, 2007

Here is part of the vba code for a query

"(Mr_Scrap.PART_NO='" & partno & "') AND (Mr_Scrap. DATE>={d '2006-12-25'}) AND (Mr_Scrap.DATE<={d '2007-07-04'})")

I would like to have the dates be from cells A2 and B2, but this does not work.

startdate = range("A2")
stopdate = range("B2")

"(Mr_Scrap.PART_NO='" & partno & "') AND (Mr_Scrap.DATE>=" & startdate & " ) AND (Mr_Scrap.DATE<=" & stopdate & " )")

View 9 Replies View Related

MSQuery - Return Length Of String

May 21, 2012

I have an ODBC connection to a db2 database in MSQuery. I want to return the length of a string. I've tried Len(string) but it says its not in the library.

View 2 Replies View Related

Data Source For Msquery Query

Nov 16, 2006

I have inherited a file that calls an Access database via Msquery. I can see the query that is being used with:

Data | Import External Data | Edit Query | Query Wizard

How can I determine the Access database that the query is using for its data source?

View 6 Replies View Related

Format Cells Returned By Msquery

Jan 31, 2007

I want to apply formatting to only the cells returned by MSQUERY.

I do not want to apply formatting to all 65535 rows on the basis they MIGHT be used by the returned data, I only want to use those that ARE.

View 4 Replies View Related

Oracle Date/Time As A Parameter In MSQuery

Nov 7, 2002

I am attempting to use MSQuery to extract records from an Oracle transaction table by passing user defined Date/Time field parameters.

So if the date range for the query is for Fiscal Period 10 of this year, my parameters would be:
[StartDate] = #2002/10/1#
[EndDate] = #2002/11/1#

Daily transaction activity is in the early morning hours ending at 6:00AM so my Criteria is:
Between [StartDate] + .25 and [EndDate] + .25
Note: The +.25 represents 1/4day = 6hrs (6:00AM)

If I use the hardcoded Start/End Dates, my query works fine, but if I try and
pass the dates as parameters I get "ORA-00932 inconsistent datatypes" error. And I can't seem to pass the Date/Time combination successfully....

If anyone has encountered a solution for how to pass a Date/Time Paremeter into MSQuery I would love to hear how you did it.
I'm starting to pull my few remaining hairs out!

[ This Message was edited by: Tuner on 2002-11-07 12:23 ]

[ This Message was edited by: Tuner on 2002-11-07 12:28 ]

[ This Message was edited by: Tuner on 2002-11-12 12:51 ]

View 6 Replies View Related

Multiple Parameters Using A Range Of Cells To MSQuery

Apr 17, 2003

how to pass multiple parameters using a range of cells to MSQuery? When I try to it tells me that I can select a single cell only. Anyone know of a new and improved sql driver to use with Excel?

View 9 Replies View Related

Disable Auto-calculate When Updating Queries Through MSQuery

May 21, 2009

Running XL07. Need to have one workbook pull data from several dozen others.

Have columns to the right that refer to the query table.

As I add in queries to other workbooks, the time to update each individual query goes up a lot; it feels as if the update time is increasing geometrically. I'm giving up after 2 hours, for query updates that used to take

View 9 Replies View Related

Simple Excel Using MSQuery To Access Data In One Of Tabs And Allow Updates

Jul 1, 2014

I'm trying to create a simple Excel spreadsheet (not looking for Access or complex relational database stuff) to have the following:

A tab with data about a person : name, date of birth, join date, and a list of sessions they attend (eg. Monday Morning, Monday afternoon etc).

A different tab in the same sheet, or a form to select from that list of people, and allow changes to the information, and the ability to save it back to the data tab. Ability to add new people or delete people would be useful.

I am looking to create this as a basis for managing sessions, creating a register etc....

Any simple spreadsheet which I can use as a starting point, or to use as a reference in getting it established?

View 3 Replies View Related

Getting Binary Bits Field In MsQuery To Show In Excel Spreadsheet

Feb 10, 2009

I am trying to do a query against my database using MsQuery, but I am having a problem with it...

One of the tables in my database stores information as Binary (Bits) instead of actual text.... When I create the Query in MsQuery, the text is displayed as desired...but when I send it to Excel that column is not displayed..

Does anyone have any ideas on how I can get it to send the column to Excel?

See attached for what I mean. The Bits column shows in MSQuery, but not in Excel.

View 14 Replies View Related







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