Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a report for upload 1

Status
Not open for further replies.

wanzek

Technical User
Mar 8, 2010
58
US
I am looking for information on creating a file for upload to a website. This file needs to have certain position starts and ends for each column. Some of the columns will be blank and others need to be a certain length. Does anyone have any information that would be helpful or know of any places with helpful information?

Thanks
 

I'm assuming that you need to end up with a text file for upload - here are two things that will make your job easier:

1. Become familiar with the len and left functions. For instance, if the FirstName in the text file needs to be 30 characters, then the formula would be:

firstnamefield + space(30-len(firstnamefield))

2. The space function can be used on its own - if you have a field in the text file that needs to be 30 spaces, then you go with:

space(30)


Depending on how many fields you have to fill, you can just create one formula and tack the elements together with a + sign:

firstnamefield + space(30-len(firstnamefield)) +
firstnamefield + space(30-len(firstnamefield)) +
address1field + space(50-len(address1field)) +
space(50) +
cityfield + space(25-len(cityfield))

etc. etc.

You'll also need to understand the various flavors of the totext function for when you're including numeric values

totext(zip) gives '74,114.00'
totext(zip,"#") gives '74114'
totext(zip),0) gives '74,114'

This can be very tedious - don't try to do it all at once. Get the first element right, then add the second, etc.









 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top