Solved

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

Posted on 1998-04-20
3
181 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 100 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

691 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