I have a query with the following SQL source:
When I run the query from a command button on a main entry form it shows the data as one would expect.
column1,column2,column3,etc
data1,data2,data3,etc
It will only show 1 record as it is pull for the current record of a subform.
I need to take this a few steps further.
I need to transpose the data so that I get the following:
Name,Value
ColumnName1,Data1
ColumnName2,Data2
ColumnName3,Data3
I need the Name,Value at the top.
I then need this to be save to a csv, with a prompt to the end user for where to save it. One of the columns will be the file name.
Anyone have any idea how to go about doing this?
If it is too hard, I will have to instruct users in the manual step of copying to excel and transposing data and then saving out to directory location.
Thanks!
misscrf
It is never too late to become what you could have been ~ George Eliot
Code:
SELECT tblProcessing.PKProcessingID, tblKeyHBCaseAsset.txtCaseAssetTag AS HBAssetTag, tblCustodian.txtCustodianAlias AS Custodian, tblAsset.dtDateCollected AS DateCollected, tblAsset.txtCollectedFrom AS CollectedFrom, tblAsset.txtCollectedLocation AS CollectedLocation, tblAsset.txtSourceDesc AS DeviceSource, tblProcessing.dtDateProcessed AS DateProcessed
FROM (((tblProcessing LEFT JOIN tblKeyHBCaseAssetCust ON tblProcessing.FKHBCaseAssetCustodian=tblKeyHBCaseAssetCust.PKHBCaseCustodianAssetKeyID) LEFT JOIN tblKeyHBCaseCust ON tblKeyHBCaseAssetCust.FKHBCaseCustodian=tblKeyHBCaseCust.PKHBCaseCustodianKeyID) LEFT JOIN tblCustodian ON tblKeyHBCaseCust.FKCustodian=tblCustodian.PKCustodianID) LEFT JOIN (tblKeyHBCaseAsset LEFT JOIN tblAsset ON tblKeyHBCaseAsset.FKAsset=tblAsset.PKAssetID) ON tblKeyHBCaseAssetCust.FKCaseAsset=tblKeyHBCaseAsset.PKHBCaseAssetKeyID
WHERE (((tblProcessing.PKProcessingID)=Forms!frmHBCase!frmProcessing.Form!PKProcessingID));
When I run the query from a command button on a main entry form it shows the data as one would expect.
column1,column2,column3,etc
data1,data2,data3,etc
It will only show 1 record as it is pull for the current record of a subform.
I need to take this a few steps further.
I need to transpose the data so that I get the following:
Name,Value
ColumnName1,Data1
ColumnName2,Data2
ColumnName3,Data3
I need the Name,Value at the top.
I then need this to be save to a csv, with a prompt to the end user for where to save it. One of the columns will be the file name.
Anyone have any idea how to go about doing this?
If it is too hard, I will have to instruct users in the manual step of copying to excel and transposing data and then saving out to directory location.
Thanks!
misscrf
It is never too late to become what you could have been ~ George Eliot