?
Solved

Concantenate in Spread 2.5 possible? Or should I write to file?

Posted on 1998-04-20
3
Medium Priority
?
182 Views
Last Modified: 2008-03-17
I want to combine 3 separate columns of my resultset (day, month, year) into 1 column in Spread 2.5 (also to add "/" between them for a good looking date like 4/20/98). Their tech support said they don't know how, and for me to write my resultset to a tab delimited file and then I can bring it in using SetText. Which way? Also, I am only using certain columns from my resultset i.e. Column 1, 4, 6, 9 etc. I don't know how to write a resultset to a file if that is the way to go. Any help greatly appreciated.
0
Comment
Question by:shubbell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Expert Comment

by:MikeABB
ID: 1425671
shubbell,
  If you have no need for the seperate columns, you can always concatinate your fields using sql.  For example, in Oracle, you could have a SQL statement that looks like this:

Select Month || '/' || Day || '/' || Year as SimpleDate from YourTable

That would give you the date in the format that you need it in for the column.

This is only a comment.  If this solves the problem for you, let me know and I'll resubmit this as an answer
0
 
LVL 1

Accepted Solution

by:
Lint earned 200 total points
ID: 1425672

I'm not sure how spread 2.5 works but,
You might try this.
Assuming the resultset holds the date in columns 1,4,6 (being month, day, year)

1) If you are loading the grid from the resultset yourself then for each row, build the new date. Example..
   dim NewDate as string ' Or use date
   NewDate = resset(1) & "/" & resset(4) & "/" & resset(6)
   ' then store the new date in the correct cell

2) If you are just pointing the grid at the resultset. Return a dummy column in your resultset for the date calculation. An example SQL example would be
   dim SQL as string
   SQL = "Select Month, Day, Year, Month + '/' + Day + '/' + Year as NewDate from MyTable "
   This will return an extra column labeled 'Newdate' that always holds the new date.  (Just like MikeABB's Answer)

Let me know if this helps!
If not then tell me more about spread 2.5 and how you interface to it!  

0
 

Author Comment

by:shubbell
ID: 1425673
I'm sorry, I should have specified. I am using a stored procedure for which I do not have rights to change (purchased package - we don't even have source code for it), so all I can do is just execute it. Spread 2.5 works like this, you Set MSRCD1.Resultset to Openresultset. Then I say
With Spread (the spread control)
.row = 0 (Header)
.col = 1 (In Spread control)
.Text = "Whatever Heading I want"
.Datafield = "Column in SQL table"
end with
I tried to say something like .Datafield = "col1 & col3 & col5" but it won't work. Their tech support said they don't know how. both of you guys answers are good, but I can't adjust the stored procedure in any way. Any other suggestions, greatly appreciated.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question