Viewing 15 posts - 556 through 570 (of 600 total)
It seems to me that the issue is the result of a strange design. The only way to determine how long a customer has continuously been a customer is...
August 3, 2010 at 10:44 am
Here's how I would do it with the datestamp field:
CREATE Table #Table_A (A_ID INT,F_Name VARCHAR(2), M_Name VARCHAR(2),L_Name1 VARCHAR(2))
INSERT INTO #Table_A
SELECT 1,'A','B','C'UNION ALL
SELECT 2,'X','Y','Z'
CREATE Table #Table_B(B_ID INT,A_ID INT,City...
July 31, 2010 at 9:27 pm
bitbucket-25253 (7/31/2010)
SELECT *
FROM Table_A a
LEFT OUTER JOIN
...
July 31, 2010 at 8:39 pm
helpdesk-1100431 (7/30/2010)
I am a having trouble in querying one-to-many relationship. let me describe the scenario here. my table structure is like this.
Table A
A_IDF_NameM_NameL_Name
1ABC
2XYZ
Table B
B_IDA_IDCityStateZip
11xxxTN37013
21yyyTX37012
Now i want to select...
July 31, 2010 at 4:57 pm
This is what I came up with (and also test data for people to find a better solution):
CREATE TABLE #codes (CodeIDint,
Codechar(4)
)
CREATE TABLE #sequences (SequenceIDint,
CodeIDint,
Seqint,
DecisionIDint)
INSERT INTO #codes (CodeID,Code)
SELECT 1,'0001' UNION ALL
SELECT...
July 29, 2010 at 2:44 pm
That doesn't quite work, Scott. It will also return any subset matches (with his test data your query returns codes 0001 and 0002)
July 29, 2010 at 2:31 pm
I assume the sequence must also be correct?
For example a user entering 2999,3000 matches code 0002. what if it's 3000, 2999 (same numbers, different sequence) instead?
July 29, 2010 at 1:53 pm
I'll give this a shot tonight. There are a few ways you could do it.
Can there be only one matching code to a given sequence?
July 29, 2010 at 1:33 pm
Is this in a stored procedure? Can you give us an idea of the input you get sent from the user and the format it is in.
It sounds like...
July 29, 2010 at 12:15 pm
Just an observation, but you say date time is formatted in yyyymmdd, but when you posted the query your between clause
was :
WHERE [StartTime] BETWEEN 20102209112223 AND 20102309112223
... which is...
July 29, 2010 at 12:02 pm
Can you post the create table script for arttemp? Even better would be the scripts for each table in your procedure, and some sample data scripted as insert commands...
July 29, 2010 at 9:22 am
Do you need both the print AND the data stored in a table, or do you need the data stored in a table INSTEAD? What are you using the...
July 29, 2010 at 8:27 am
Ish Fad (7/29/2010)
I uesd store procedure as advice my above. But I am still getting this error;
Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC SQL Server Driver][SQL Server]Error converting data...
July 29, 2010 at 8:20 am
Jeff Moden (7/29/2010)
Paul White NZ (7/29/2010)
There is a (very nasty) one-step global cursor + dynamic sql workaround, which Jeff is just going to love:
Heh... I AM curious why you'd show...
July 29, 2010 at 8:07 am
Can you post DDL?
I THINK your routeplaces table has a row for each place, but the way you posted the sample data makes it look like there is one row...
July 28, 2010 at 12:22 pm
Viewing 15 posts - 556 through 570 (of 600 total)