Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

863 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

18 Experts available now in Live!

Get 1:1 Help Now