ms-query

iOS Swift: How to perform SQL SUM() function using MSQuery and NSPredicate?

|▌冷眼眸甩不掉的悲伤 提交于 2020-06-29 03:49:16
问题 For example, I would like something similar to: select SUM[likes] from [MyAzureSQLService].[InstagramPost] where user == 'rain' Here, the "likes" is unsigned integer column in azure sql table "[MyAzureSQLService].[InstagramPost]", I wanted to query the sum number of all likes received by a specific user. My Swift code in iOS is like this: guard let table = client.table(withName: tableName) else { return } guard let query = MSQuery(table: table) else { return } query.predicate = NSPredicate

iOS Swift: How to perform SQL SUM() function using MSQuery and NSPredicate?

人走茶凉 提交于 2020-06-29 03:49:15
问题 For example, I would like something similar to: select SUM[likes] from [MyAzureSQLService].[InstagramPost] where user == 'rain' Here, the "likes" is unsigned integer column in azure sql table "[MyAzureSQLService].[InstagramPost]", I wanted to query the sum number of all likes received by a specific user. My Swift code in iOS is like this: guard let table = client.table(withName: tableName) else { return } guard let query = MSQuery(table: table) else { return } query.predicate = NSPredicate

MS Access use table field as query criteria

 ̄綄美尐妖づ 提交于 2019-12-25 14:28:00
问题 I have a question. Is it possible to use a table as a query criteria to count how many items in another table? I have two tables. Table 1 is the query criteria. Table 2 is a table with many data. I'd like to have a new table or insert into an existing table like the figure below. Count number of items from table 2 with criteria from table 1. I can run the query many times to count the data of different years. So the main problem is how to count the items use another table as criteria. I have

Why does my LIKE filter only match on one value?

时光总嘲笑我的痴心妄想 提交于 2019-12-25 09:24:56
问题 I have this excel file which is giving me unexpected results on an SQL query with a join on LIKE criteria. Here is the SQL statement: SELECT CO.MATERIALS, CO.SIZES, CO.TOOLS, IR.PN, IR.BODYJAW FROM `CROSSJOIN$` CO LEFT JOIN `INSERTS$` IR ON CO.TOOLS=IR.TOOL AND ((IR.MATERIAL Like '%'+CO.MATERIALS+'%')) AND ((IR.SIZE Like '%'+CO.SIZES+'%')) And the issue is, that the criteria for IR.MATERIAL will only match on one value "333". I can't figure it out. Here's a visual explanation of the what's

Excel: filter table rows by specified column value

好久不见. 提交于 2019-12-24 17:04:54
问题 I have a table with first column as primary key. Ex: id value1 value2 1 10 5 2 2 3 3 12 5 .. I also have a second list of id's I want to select, which can have repeated ids. Ex: selectId 1 2 2 2 5 10 .. How can I "merge" the two tables (something like INNER JOIN) to obtain: id value1 value2 1 10 5 2 2 3 2 2 3 2 2 3 5 99 99 10 22 22 .. I tried using 'Microsoft Query' from Data > Extern Data to join the two tables. The problem is that it seems it cannot handle tables with more than 256 columns.

Multipart identifier error in Excel 2007 MS Query but not in SQL Server 2008

一世执手 提交于 2019-12-24 16:59:59
问题 I have the following SQL code SELECT pd1.Meter, pd1.BasicPool, pd1.RateClass, pd1.Flowdate, (SELECT upOrDownContract FROM PipelineData pd WHERE pd.id = pd1.sibling) AS DnK, match.Volume, (SELECT Name FROM Pipeline P WHERE P.id = ISNULL(pd2.pipelineID, t.PipelineId)) AS Pipeline, (SELECT Name FROM Client C WHERE C.id = t.ClientId) AS CounterParty FROM MatchingHistoryBothSides match LEFT JOIN PipelineData pd1 ON match.type1 = 'PipelineDataVO' AND match.id1 = pd1.ID LEFT JOIN PipelineData pd2 ON

How to get Excel to reliably execute sp_executesql from a query table on a worksheet?

早过忘川 提交于 2019-12-24 00:16:47
问题 In MS Excel, if you create a QueryTable with Microsoft Query, and your SQL query cannot be visually presented by Microsoft Query, then you are not allowed to provide parameters for that query. Which is a shame, so there is this awesome technique that allows parameters anyway: {CALL sp_executesql (N'select top (@a) * from mytable', N'@a int', ?)} You provide the query in the ODBC CALL form and it works with parameters. Unless it does not. While on some computers it works flawlessly, on other

Excel SSIS query returns null columns in Excel but not in Management studio

孤街浪徒 提交于 2019-12-20 04:21:38
问题 I did my best to look around the web but this problem eludes me. I have a stored procedure in SSIS that works fine. It does a bunch of stuff eventually returning some numbers and text. The procedure itself uses #temp tables since the data does not need to exist beyond the proc run and returns ~931K rows. The next step was to bring the output of the proc into excel. Using MS query, I call the proc including the necessary parameters. it runs but the only data I get back is the columns with

What is Subqueries syntax for Microsoft Query?

与世无争的帅哥 提交于 2019-12-12 04:28:22
问题 I am trying to do a simple subquery join in Microsoft Query, but I cannot figure out the syntax. I also cannot find any documentation for the syntax. How would I write the following query in Microsoft Query? SELECT * FROM ( SELECT Col1, Col2 FROM `C:\Book1.xlsx`.`Sheet1$` ) AS a JOIN ( SELECT Col1, Col3 FROM `C:\Book1.xlsx`.`Sheet1$` ) AS b ON a.Col1 = b.Col1 Is there official documentation for Microsoft Query? 回答1: SELECT * FROM (SELECT ID, Company FROM (`Sheet1$`)) AS a INNER JOIN (SELECT

Excel - Microsoft Query - SQL Server login - “Use Trusted Connection” default setting

a 夏天 提交于 2019-12-12 03:02:35
问题 Couple of years using this site is as an invaluable resource, but first time posting. I am having a little trouble with external data connections in Excel, specifically connecting to SQL Server through Microsoft Query. Whenever I click [Get External Data > From Other Sources > From Microsoft Query > Choose Data Source: SQL Server] it takes about 20 seconds before an error pops up: Error 18452 Login Failed Untrusted Domain After I click OK a SQL Server Login dialog box pops up with "Use