Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 1998-04-20
3
Medium Priority
?
183 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…
Suggested Courses

610 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