FAQ Database Discussion Community


VBA If textbox is empty display all values

vba,ms-access,empty-string,ms-query
I have 2 textboxes and a button. The button opens a query with the values of the textboxes. Everything works fine, except when one textbox is empty then I want to find all the records from that textbox(So far I've tested it on textbox2). Here is my code: Private Sub...

Excel ACE.OLEDB: COUNTIF equivalent in query

sql,excel,vba,ms-query,aceoledb
I developed the following Microsoft Query in ACE.OLEDB: SELECT Name, Country (SELECT COUNT(*) FROM Table1 as T1 WHERE Name = T.Name AND Country = T.Country AND Description="Work" GROUP BY Name, Country) / COUNT(*) FROM Table1 as T GROUP BY Name, Country The query works fine but it lasts forever to...

Using field alias in MSQuery does not work with DB2

db2,ms-query,ibm-data-studio
This query works in data studio, but fails to show alias in MS Query! I have tried different types such as "",'',[] and even https://support.microsoft.com/en-us/kb/298955 SELECT 'TRANIN'AS NAME, SUM(CASE WHEN ALT3.TRANINDT BETWEEN 20150603 AND 20150601 THEN 1 else 0 END) AS CurrentMonth, SUM(CASE WHEN ALT3.TRANINDT BETWEEN 20150501 AND 20150531 THEN...

Transform and Pivot in Excel - MS Query

excel-2007,transform,ms-query
I have 4 field in my table : NO. | Specification | Specification Value | Description 1 Color Blue a 1 Size 6" a 2 Color Red b 2 Size 8" b I am trying to Pivot it and its giving me an error. TRANSFORM FIRST(Specification Value) SELECT items.'No.' FROM...