473,480 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Export Data in a specific format

41 New Member
I have a transaction table that I need to export for our financial system to import. It has a lot of zero's and a lot of spaces in the requested file.

Is there a way to do that and if there is how?

Can someone please help me in explaining how to extract data to a txt file as well. Here is my SQL statement thus far:

SELECT AccountNumber, CustomerID, Sum(CheckTotal) As CKT, Sum(PSD.Quantity) as QTY, Sum(ItemPrice * PSD.Quantity) As ItPrice, Sum(FCharge) as FCharge, Sum(SCharge) as SCharge, Sum((ItemPrice * PSD.Quantity) + FrankingCharge + ServiceCharge) As Total From PSD INNER JOIN Customer ON PSD.CustomerId = Customer.ID INNER JOIN Item ON PSD.ItemId = Item.ID Where PSD.Datecreated Between '12/01/2006 01:00:00 AM' and '12/31/2006 11:00:00 AM' Group By AccountNumber

Thanks
Dec 21 '06 #1
7 1662
AricC
1,892 Recognized Expert Top Contributor
What language are you using to do this?
Dec 22 '06 #2
almaz
168 Recognized Expert New Member
If you don't need to incorporate the export/import functionality in application - use Data Transformation Services (DTS).
Dec 25 '06 #3
Lawrence 007
41 New Member
Guys,

I was away for the holiday, Sorry.

The language I am using is VB.

I am not familiar with DTS. Can you explain how that works please.

Thanks!!
Dec 30 '06 #4
almaz
168 Recognized Expert New Member
See here: data transformation services
Jan 1 '07 #5
navamnk
15 New Member
create a view (based on your query + include some more where condition to eliminate zeros & spaces) and then directly insert it to the new table.

like,

insert into ...(finance. table)
select ....
from (new view)
Jan 3 '07 #6
navamnk
15 New Member
use OSQL command line utility to get all the result in a txt file.

open command prompt and type OSQL /? for more options
Jan 3 '07 #7
Lawrence 007
41 New Member
That sounds great, but as I am new to VB I might need some help on how to call that through vb. Any Ideas?
Jan 3 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1830
by: Do Park via SQLMonster.com | last post by:
Hello all, I don?t often export data from a table. I am wondering how you export data from a table. I?d like to know how you export in real world. Do you export data from a table to a flat...
6
33796
by: Oliver Stratmann | last post by:
Hello all, is there another way to export data to a csv-file (comma-separated format)? We tried the EXPORT-command and got the following error " SQL1325N The remote database environment does...
2
11451
by: hikums | last post by:
Hello, If I export a file containing date field, export to "/james/j.txt" of DEL select a1,adate from a The date is represented in YYYY/MM/DD format as expected. Output I need is to be in...
1
2138
by: cab2 | last post by:
We currently have an application built in Access that takes in a csv file using docmd.transfertext. We allow users to export their data to a file for later use (csv format). Users are also...
5
8652
by: Igor | last post by:
Hi everyone! I have a question about exporting data to Microsoft Excel. I am writing program in C# and have to export some data to excel workbook. It works very good using OLE technology, but...
3
11669
by: Scott M. Lyon | last post by:
I'm trying to figure out a way to export data (actually the result of a Stored Procedure call from SQL Server) into a specified Excel spreadsheet format. Currently, I have the data read into a...
2
296
by: edr | last post by:
Hi, I have a excel file templete, where i need to populate the raw data in the one of the sheet with the specific predefined format. based on the that data, a VBA program will fetch the data...
4
4886
by: Max2006 | last post by:
Hi, We are developing a SQL server based asp.net application. As part of requirement we should allow users import/export some relational data through web user interface. We are investigation...
12
5617
by: =?Utf-8?B?YXVsZGg=?= | last post by:
i current have a way to read both local and remote machines registry keys and create a textual view (.txt output). i now looking for ways to do export of local and remote mahcine registry keys...
17
19833
by: chadh | last post by:
Hello, I'm having some troubles exporting a query to a csv file. I am able to use the doCMD.TransferText to output the query to the csv file, however, I cannot get it to use the Export...
0
6918
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7057
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7102
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6756
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5357
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4798
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4495
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3008
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1310
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.