thefourthwall
IS-IT--Management
I export 2 fields of data from an existing query. The query is
This data is exported to a text file by
Now management wants additional data exported, so I changed the query to
I've only exported existing fields; what's the best way to export "Expr1"?
Code:
SELECT tblDevice.EID, tblDevice.Cell_Number
FROM tblDevice
WHERE tblDevice.EID IS NOT NULL AND tblDevice.EID NOT LIKE '[A-Z]*';
Code:
'Begin variable declarations for Export Cell Numbers & EID's
Dim strFilePath As String 'For the file path of your exported file - where you want to save it.
Dim strFileName As String 'For the actual file name of your exported workbook.
Dim strQuery As String 'Your Query Name
strFilePath = "G:\Share\IS\WSU\Administrative\Cell_Phone_Database\Exported\"
strFileName = "EIDs_and_CellNumbers" & ".txt"
strQuery = "qryEportEID_Phone_Number"
DoCmd.TransferText acExportDelim, "QryEportEID_Phone_Number Export Specification", _
strQuery, strFilePath & strFileName, False
UpdateData_Exit:
Exit Function
UpdateData_Err:
MsgBox Error$
Resume UpdateData_Exit
End Function
Code:
SELECT tblDevice.EID, Mid([cell_number],1,3) & "-" & Mid([cell_number],4,3) & "-" & Mid([cell_number],7,4) AS Expr1, EMPLOYEE.AD_USER_NAME
FROM tblDevice INNER JOIN EMPLOYEE ON tblDevice.EID = EMPLOYEE.EMPLOYEE_ID
WHERE (((tblDevice.EID) Is Not Null And (tblDevice.EID) Not Like '[A-Z]*'));