473,608 Members | 2,689 Online
Bytes | Software Development & Data Engineering Community
+ 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.Quantit y) 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 1667
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
1842
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 file or what type? There are many selections when you choose file type. When do you need to export data? How often? Do you use DTS rather than export wizard?
6
33815
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 not support the command or one of the command options. Explanation: An attempt has been made to issue a DB2 workstation database specific command or command option against a host database through DB2
2
11478
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 "yyyymmdd" without delimiter. MODIFIED BY DATESISO option has a delimiter.
1
2156
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 allowed to re-import their archived data. This all works fine, until we have to update the application for international users. The original csv files sent to users contain dates and numbers in US format. However, once imported, the numbers appear...
5
8663
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 it requires Microsoft Excel installed on every machine with my program. It is not quite convenient to do so. Is there another way to export data to Excel, or how simply create file of Microsoft Excel format from my program (of cause, the format of...
3
11681
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 DataSet that consists of one DataTable. That DataTable has a specific name (for arguments purposes, let's say it's called "DataGrid"), that I need to use as the tab name in the exported Excel
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 from sheet 1 and draw graphs in various other sheets. open the specific excel file from asp.net and then plot the data as per the pre requisite and generate graphs etc from this. I have had a look at some third party controls
4
4900
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 which file format would be the most efficient format to import export relational data. So far we came up with two options: XML and Access MDB files and we prefer MDB files.
12
5633
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 into ".reg" file format via C#. is this do able? what do i need to research to do this? or is where i need to windows WinApi?
17
19864
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 Specifications and on some queries data is showing up in what looks like HEX. Below is an example: SQL Statement for Invoice_Header Query: SELECT !! AS inv_id, !! AS tran_date, Sum(Item_Lot_Query.total_gross) AS total_gross FROM Item_Lot_Query; The SQL...
0
8050
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7987
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8472
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8130
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6805
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6000
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3954
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2464
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 we have to send another system
0
1318
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.