Solved

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

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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 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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now