@Trebor76
Thanks, but it also needs to include this information WHERE ColumnO = 100 AND ColumnP = 10 AND ColumnQ = 30
Should I write it as
SELECT COUNT(*) AS Unique_Count FROM (SELECT DISTINCT ColumnO, ColumnP, ColumnQ, ColumnX, ColumnY, ColumnZ FROM Table_name WHERE ColumnO = 100 AND ColumnP = 10 AND ColumnQ = 30) AS Temp
Maybe I don't need Unique_Count and Temp, shall I?
SELECT COUNT(*) FROM (SELECT DISTINCT ColumnO, ColumnP, ColumnQ, ColumnX, ColumnY, ColumnZ FROM Table_name WHERE ColumnO = 100 AND ColumnP = 10 AND ColumnQ = 30)
In VBA, can I assign it to variable directly?
Dim NumOfRecord As Integer
NumOfRecord = SELECT COUNT(*) FROM (SELECT DISTINCT ColumnO, ColumnP, ColumnQ, ColumnX, ColumnY, ColumnZ FROM Table_name WHERE ColumnO = 100 AND ColumnP = 10 AND ColumnQ = 30)
Edit: here is more detailed code. How can I get the final output number? I have the SELECT statement, but how to pass the value to a variable NumOfRecord ?
Bookmarks