Re: SQL Question

2009-07-01 Thread C. Hatton Humphrey
> Go the other way don't tear apart the old flat table.  Create a > report from the new data that pulls the pieces back together into a > de-normalized flat table.  That should just be normal joins and a fairly > simple query. Hmmm... had not thought about it from that direction; the WHERE cl

Re: SQL Question

2009-07-01 Thread Ian Skinner
C. Hatton Humphrey wrote: > Anyone have any better suggestions for a solution? Go the other way don't tear apart the old flat table. Create a report from the new data that pulls the pieces back together into a de-normalized flat table. That should just be normal joins and a fairly simple

SQL Question

2009-07-01 Thread C. Hatton Humphrey
Here's a fun question for the morning! I have to write a query that compares the values in a flat table built in FoxPro over a decade ago to it's newly built normalized version. In the flat table there is an identifier column as well as a 39 columns (7 different items tracked with various value p

Re: sql question... (limit 32)

2008-09-17 Thread Judah McAuley
My first guess would be to look for triggers or circular foreign key references. Often times people will declare a cascading delete on a foreign key so when you delete the record, it deletes records in tables that are related to it. But if one of those other tables has a foreign key that points bac

sql question... (limit 32)

2008-09-17 Thread Paul Ihrig
so i just made a new sql server and moved data from the old. every thing is singingly great... except when i try to delete some thing General Details: [Macromedia][SQLServer JDBC Driver][SQLServer]Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32).

RE: SQL Question

2008-03-17 Thread Scott Stewart
: Re: SQL Question Depends on your database. In sql server, it's an identity field, in Oracle, you'd use a sequence and do mysequence.nextval. Also, count is probably a reserved word in whatever database you're using, so don't name your column that. You might also be able

Re: SQL Question

2008-03-17 Thread Deanna Schneider
Depends on your database. In sql server, it's an identity field, in Oracle, you'd use a sequence and do mysequence.nextval. Also, count is probably a reserved word in whatever database you're using, so don't name your column that. You might also be able to do something like: Insert into myTable(

SQL Question

2008-03-17 Thread Scott Stewart
Hey all, How do I create a row in a query that contains a sequential number IE: --- Count | Fieldname Thanks sas -- Scott Stewart ColdFusion Developer SSTWebworks 4405 Oakshyre Way Raleigh, NC. 27616 (919) 874-6229 (home) (703) 220-2

Re: SQL Question

2006-10-30 Thread G Money
PROTECTED] > Sent: Monday, October 30, 2006 3:36 PM > To: CF-Community > Subject: RE: SQL Question > > Yep. I got this off the HOF SQL list: > > > Select DateCreated, FirstName, LastName, Email > from dbo.IBS_ShowLitRequest > where coalesce( firstname,''

RE: SQL Question

2006-10-30 Thread Duane
Whoops, I put the real db name in there but you get the idea. -Original Message- From: Duane [mailto:[EMAIL PROTECTED] Sent: Monday, October 30, 2006 3:36 PM To: CF-Community Subject: RE: SQL Question Yep. I got this off the HOF SQL list: Select DateCreated, FirstName, LastName, Email

RE: SQL Question

2006-10-30 Thread Duane
mail >From dbo.IBS_ShowLitRequest Where firstname is null and lastname is null and coalesce( email,'' ) <> '' group by firstname, lastname, email -Original Message- From: Nick McClure [mailto:[EMAIL PROTECTED] Sent: Monday, October 30, 2006 3:24 PM To: CF

RE: SQL Question

2006-10-30 Thread Nick McClure
Which date do you want? You aren't going to be able to do this easily because the email is distinct, but the date is not. > -Original Message- > From: Duane [mailto:[EMAIL PROTECTED] > Sent: Monday, October 30, 2006 2:29 PM > To: CF-Community > Subject: RE: SQL Ques

RE: SQL Question

2006-10-30 Thread Nick McClure
The Dreaded Union? > -Original Message- > From: Duane [mailto:[EMAIL PROTECTED] > Sent: Monday, October 30, 2006 2:29 PM > To: CF-Community > Subject: RE: SQL Question > > That won't work. You have to include all the fields in your select > statement > in

RE: SQL Question

2006-10-30 Thread Duane
That won't work. You have to include all the fields in your select statement in your group by clause. Duane -Original Message- From: William Bowen [mailto:[EMAIL PROTECTED] Sent: Monday, October 30, 2006 3:17 PM To: CF-Community Subject: Re: SQL Question Group By Email? On 10/

Re: SQL Question

2006-10-30 Thread William Bowen
Group By Email? On 10/30/06, Duane <[EMAIL PROTECTED]> wrote: > Hi All, > > I have a sql question for anyone willing to help me get my head unstuck. > > > I have the following sample data: > > RegDate FirstName LastNameEmail > 10/1/2006 NULL

Re: SQL Question

2006-10-30 Thread G Money
gt; Hi All, > > I have a sql question for anyone willing to help me get my head unstuck. > > > I have the following sample data: > > RegDate FirstName LastNameEmail > 10/1/2006 NULLNULL[EMAIL PROTECTED] > 10/2/2006 NULL

SQL Question

2006-10-30 Thread Duane
Hi All, I have a sql question for anyone willing to help me get my head unstuck. I have the following sample data: RegDate FirstName LastNameEmail 10/1/2006 NULLNULL[EMAIL PROTECTED] 10/2/2006 NULLNULL[EMAIL PROTECTED

Re: SQL Question

2006-09-12 Thread G Money
Correct. I've often pined for a "list" grouping functionwhich would have helped you in this situation. SOmething like: select emp_id, list(location_id) as location_ids from table where whatever grouped by emp_id Then the output would be: Emp ID Location_ids 1

Re: SQL Question

2006-09-12 Thread Rick Root
G Money wrote: > How so? > > I still don't think he's going to get the values in a list form in a single > column using just SQL. > > On 9/12/06, Andrew Scott <[EMAIL PROTECTED]> wrote: > >>left outer join would have worked better left outer join would not have worked at all. Try it. simple j

Re: SQL Question

2006-09-12 Thread G Money
something like that > > > > > > -Original Message- > > From: Duane [mailto:[EMAIL PROTECTED] > > Sent: Monday, September 11, 2006 5:13 PM > > To: CF-Community > > Subject: SQL Question > > > > Hi All, > > > > Is there anyway with

Re: SQL Question

2006-09-12 Thread Andrew Scott
Locid > > > Did not test it but something like that > > > -Original Message- > From: Duane [mailto:[EMAIL PROTECTED] > Sent: Monday, September 11, 2006 5:13 PM > To: CF-Community > Subject: SQL Question > > Hi All, > > Is there anyway within an sql q

RE: SQL Question

2006-09-12 Thread Duane
I was using asp.net repeaters, and couldn't figure the nesting out. There were 4 columns in the output that had to be nested. Duane -Original Message- From: Nick McClure [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 12, 2006 9:42 AM To: CF-Community Subject: RE: SQL Question

RE: SQL Question

2006-09-12 Thread Nick McClure
You could have nested a while loop in the output loop. > -Original Message- > From: Duane [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 12, 2006 8:19 AM > To: CF-Community > Subject: RE: SQL Question > > I ended up using cursors and creating a temp table o

RE: SQL Question

2006-09-12 Thread Duane
I ended up using cursors and creating a temp table on the fly. Duane -Original Message- From: Zaphod Beeblebrox [mailto:[EMAIL PROTECTED] Sent: Monday, September 11, 2006 10:20 PM To: CF-Community Subject: Re: SQL Question you might be able to leverage the coalesce function like this

Re: SQL Question

2006-09-11 Thread Zaphod Beeblebrox
you might be able to leverage the coalesce function like this article: http://www.sqlteam.com/item.asp?ItemID=2368 On 9/11/06, Duane <[EMAIL PROTECTED]> wrote: > Hi All, > > Is there anyway within an sql query to return a sub query that has multiple > records? Ex: > > Users: > UID Name > 1

Re: SQL Question

2006-09-11 Thread Rick Root
Duane wrote: > > I'm trying to get around some pain in the ass stuff using the asp repeater > control. ASP? Ouch, there's your problem ;) ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-da

RE: SQL Question

2006-09-11 Thread Duane
I wish I could use CF for this :( I'm trying to get around some pain in the ass stuff using the asp repeater control. Duane -Original Message- From: Rick Root [mailto:[EMAIL PROTECTED] Sent: Monday, September 11, 2006 6:18 PM To: CF-Community Subject: Re: SQL Question Duane

Re: SQL Question

2006-09-11 Thread Rick Root
Adkins, Randy wrote: > > Select users.uid, users.name, locations.location > From users > inner join UserLoc on UserLoc.UID = users.uid > inner join locations on UserLoc.LocID = locations.Locid > > Did not test it but something like that It wouldn't work. It would return multiple rows for each

Re: SQL Question

2006-09-11 Thread Rick Root
Duane wrote: > > Is it possible to return a record set that looks like: > UID NameLocation > 1 FredMain Office, Cafeteria > 2 Bob Gymnasium > 3 MaryCafeteria Not that I'm aware of. You'd have to either build a stored procedure or return the data like this: UID

RE: SQL Question

2006-09-11 Thread Adkins, Randy
day, September 11, 2006 5:13 PM To: CF-Community Subject: SQL Question Hi All, Is there anyway within an sql query to return a sub query that has multiple records? Ex: Users: UID Name 1 Fred 2 Bob 3 Mary UID LocID 1 1 1 2 2 3 3 2 LocID Locatio

SQL Question

2006-09-11 Thread Duane
Hi All, Is there anyway within an sql query to return a sub query that has multiple records? Ex: Users: UID Name 1 Fred 2 Bob 3 Mary UID LocID 1 1 1 2 2 3 3 2 LocID Location 1 Main Office 2 Cafeteria 3 Gymnasium Is it pos

Re: Tim's House closing was (RE: SQL Question, Switch Case )

2006-04-03 Thread Chesty Puller
d to be "Myrtle Beach AFB FCU". Military has a lot of credit unions. - Matt - Original Message - From: "Jerry Johnson" <[EMAIL PROTECTED]> To: "CF-Community" Sent: Monday, April 03, 2006 3:14 PM Subject: Re: Tim's House closing was (RE: SQL Question

RE: Tim's House closing was (RE: SQL Question, Switch Case )

2006-04-03 Thread Scott Stewart
bject: Re: Tim's House closing was (RE: SQL Question, Switch Case ) Does anyone know if this also used to be called the Naval Air Federal Credit Union? I once built a set of kiosks that functioned as mulitmedia-rich ATMs without the money slot for the NAFCU. On 4/3/06, Scott Stewart <[EM

Re: Tim's House closing was (RE: SQL Question, Switch Case )

2006-04-03 Thread Jerry Johnson
Does anyone know if this also used to be called the Naval Air Federal Credit Union? I once built a set of kiosks that functioned as mulitmedia-rich ATMs without the money slot for the NAFCU. On 4/3/06, Scott Stewart <[EMAIL PROTECTED]> wrote: > I've got all of my accounts and two mortgages thro

RE: Tim's House closing was (RE: SQL Question, Switch Case )

2006-04-03 Thread Scott Stewart
day, April 03, 2006 2:44 PM To: CF-Community Subject: Re: Tim's House closing was (RE: SQL Question, Switch Case ) Yep... I'm buying a new car and I'm going to try them (I've been a member since 1990). They have fantastic rates. Also, they are the largest credi

Re: Tim's House closing was (RE: SQL Question, Switch Case )

2006-04-03 Thread Chesty Puller
F-Community" Sent: Monday, April 03, 2006 2:06 PM Subject: RE: Tim's House closing was (RE: SQL Question, Switch Case ) > If this one goes under, try Navy Federal Credit Union. You should be > eligible under vet status. They're fast and will work with you. > > Glad to

RE: Tim's House closing was (RE: SQL Question, Switch Case )

2006-04-03 Thread Scott Stewart
2:25 PM To: CF-Community Subject: RE: Tim's House closing was (RE: SQL Question, Switch Case ) Can't do the VA thing, too much money, or this shit would have been dealt with already. -- Timothy Heald Analyst, Architect, Developer [EMAIL PROTECTED] W: 202-228-8372 C: 703-300-3911 ---

RE: Tim's House closing was (RE: SQL Question, Switch Case )

2006-04-03 Thread Loathe
06 PM To: CF-Community Subject: RE: Tim's House closing was (RE: SQL Question, Switch Case ) If this one goes under, try Navy Federal Credit Union. You should be eligible under vet status. They're fast and will work with you. Glad to know that the insurance came through.. Thanks

RE: Tim's House closing was (RE: SQL Question, Switch Case )

2006-04-03 Thread Scott Stewart
puter. -Original Message- From: Loathe [mailto:[EMAIL PROTECTED] Sent: Monday, April 03, 2006 2:01 PM To: CF-Community Subject: RE: Tim's House closing was (RE: SQL Question, Switch Case ) It didn't. We lost our mortgage 2 hours before the closing. Going with a new company now.

Re: Tim's House closing was (RE: SQL Question, Switch Case )

2006-04-03 Thread Dana Tierney
300-3911 >-Original Message- >From: Scott Stewart [mailto:[EMAIL PROTECTED] >Sent: Monday, April 03, 2006 10:12 AM >To: CF-Community >Subject: Tim's House closing was (RE: SQL Question, Switch Case ) > >Thanks Tim, > >How'd the closing go? > >

RE: Tim's House closing was (RE: SQL Question, Switch Case )

2006-04-03 Thread Loathe
#x27;s House closing was (RE: SQL Question, Switch Case ) Thanks Tim, How'd the closing go? Thanks Scott Scott A. Stewart Webmaster/ Developer GlobalNet Services, Inc http://www.gnsi.com 11820 Parklawn Dr Rockville, MD 20852 Voice: (301) 770-9610 x 335 Fax: (301) 770-9611 The info

Re: SQL Question, Switch Case

2006-04-03 Thread Jochem van Dieten
>We don't know. I was trying to see if it was even possible before >attempting. I very much doubt it is going to help you. Stored procedures are faster because they are preplanned and precompiled, but with all the LIKE statements it is pretty much impossible to use a partial indexscan on the tab

Tim's House closing was (RE: SQL Question, Switch Case )

2006-04-03 Thread Scott Stewart
ictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. -Original Message- From: Loathe [mailto:[EMAIL PROTECTED] Sent: Sunday, April 02, 2006 9:10 PM To: CF-Community Subject: RE: SQL Que

RE: SQL Question, Switch Case

2006-04-03 Thread Scott Stewart
2006 6:47 AM To: CF-Community Subject: Re: SQL Question, Switch Case > Here's what I have, it was written by another developer but I've been tasked > with trying to make it run faster > > > SELECT top 100 > INVN AS EntityId, ... > FRO

RE: SQL Question, Switch Case

2006-04-02 Thread Loathe
don't have to mees around with the wheres and ands. -- Timothy Heald Analyst, Architect, Developer [EMAIL PROTECTED] W: 202-228-8372 C: 703-300-3911 -Original Message- From: Scott Stewart [mailto:[EMAIL PROTECTED] Sent: Friday, March 31, 2006 11:19 AM To: CF-Community Subject: SQL Que

Re: SQL Question, Switch Case

2006-04-01 Thread Jochem van Dieten
> Here's what I have, it was written by another developer but I've been tasked > with trying to make it run faster > > > SELECT top 100 > INVN AS EntityId, ... > FROM ENTITY_ALL > WHERE 1 = 1 > > AND > > > ENTITY_ALL.INVN LIKE '%#attributes.Keywords#%' > . > > ((ENT

Re: SQL Question, Switch Case

2006-03-31 Thread Chris Stoner
You can do something like the code below. The default case (for all) cannot be handled by a case statement, sot it has to be handled by a separate query (chosen by an if statement). Also, I am not on MS-SQL server any more (currently using oracle) and I am not sure if I remember the concatenation

RE: SQL Question, Switch Case

2006-03-31 Thread Nick McClure
54 PM > To: CF-Community > Subject: RE: SQL Question, Switch Case > > Chris, > > Here's what I have, it was written by another developer but I've been > tasked > with trying to make it run faster > > > SELECT top 100 > INVN AS EntityId, &

RE: SQL Question, Switch Case

2006-03-31 Thread Scott Stewart
cipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. -Original Message- From:

Re: SQL Question, Switch Case

2006-03-31 Thread Chris Stoner
Well it *would* work but its will probably not give you what you are looking for in the format you have it (assumption on my part). Basically what the where clause is saying is where @someVar = (the result of the case statement) So assuming in your example that @someVar is coming in with a value o

RE: SQL Question, Switch Case

2006-03-31 Thread Scott Stewart
fy us immediately by replying to the message and deleting it from your computer. -Original Message- From: Chris Stoner [mailto:[EMAIL PROTECTED] Sent: Friday, March 31, 2006 12:51 PM To: CF-Community Subject: Re: SQL Question, Switch Case Or to more directly tie in with your questio

Re: SQL Question, Switch Case

2006-03-31 Thread Chris Stoner
Or to more directly tie in with your question: SELECT* FROMMY_FAKE_TABLE WHEREFAKE_COLUMN = CASE WHEN FAKE_COLUMN_2 = 'A' THEN @ARGUMENT_A WHEN FAKE_COLUMN_2 = 'B' THEN @ARGUMENT_B ELSE @ARGUMENT_DEFAULT END On 3/31/06, Chris Stoner <[EMAIL

Re: SQL Question, Switch Case

2006-03-31 Thread Chris Stoner
Yes to a point...such as you can do something like my example below (not tested,obviously). The issue you will run into is that you wont be able to have a where clause with multiple filters. You basically can use the case statement to equate a specific column to another column depending on the co

SQL Question, Switch Case

2006-03-31 Thread Scott Stewart
All, Can you use a switch case statement to build a dynamic where clause based on parameters passed to a stored procedure? I'm using T-SQL in SQLServer 2000 IE: Case where entity_type is X "piece of where clause" Case where enity_type is Y "piece of where clause" Thanks Sco

Re: SQL Question... brain freeze

2005-07-29 Thread William Bowen
Supercool! That worked to get the multiple (> 2) records located. Thanks for you help!!! On 7/29/05, Deanna Schneider <[EMAIL PROTECTED]> wrote: > Try this. > > SELECT contentid > FROM mytable > GROUP BY contentid > Having count(contentid) = 2 > > > > On 7/28/05, William Bowen <[EMAIL PROTE

Re: SQL Question... brain freeze

2005-07-29 Thread Greg Morphis
select content_id, count(*) as cnt from your_table group by content_id having cnt > 1 On 7/28/05, William Bowen <[EMAIL PROTECTED]> wrote: > there must be a way to do this but I just can't think of it... > > I've got a Boundary table that holds the list of tree nodes for a web site. > > the

Re: SQL Question... brain freeze

2005-07-29 Thread Deanna Schneider
Try this. SELECT contentid FROM mytable GROUP BY contentid Having count(contentid) = 2 On 7/28/05, William Bowen <[EMAIL PROTECTED]> wrote: > there must be a way to do this but I just can't think of it... > > I've got a Boundary table that holds the list of tree nodes for a web site. > > the

SQL Question... brain freeze

2005-07-28 Thread William Bowen
there must be a way to do this but I just can't think of it... I've got a Boundary table that holds the list of tree nodes for a web site. there are two columns. content_ID and boundary now, for each "record" in the tree there are two entries, a beginning boundary and an ending boundary so reco

Re: SQL Question

2005-07-08 Thread Marlon Moyer
Thank you for noticing. :) On 7/7/05, Loathe <[EMAIL PROTECTED]> wrote: > You sir are a sexy biotch :) > > -Original Message- > From: Marlon Moyer [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 07, 2005 10:53 PM > To: CF-Community > Subject: Re: SQL Ques

RE: SQL Question

2005-07-07 Thread Loathe
You sir are a sexy biotch :) -Original Message- From: Marlon Moyer [mailto:[EMAIL PROTECTED] Sent: Thursday, July 07, 2005 10:53 PM To: CF-Community Subject: Re: SQL Question I had a little extra code in the previous one. insert into application_skills SELECT AS candidate_id

Re: SQL Question

2005-07-07 Thread Marlon Moyer
I had a little extra code in the previous one. insert into application_skills SELECT AS candidate_id, AS skill_id, as proficiency_id, skillType_id FROMcomputerSkills_lookup where skill_id = On 7/7/05, Marlon Moyer <[EMAIL PROTECTED]> wro

Re: SQL Question

2005-07-07 Thread Marlon Moyer
insert into application_skills SELECT AS candidate_id, AS skill_id, as proficiency_id, skillType_id FROM(select skillType_id from computerSkills_lookup where skill_id = ) skills On 7/7/05, Loathe <[EMAIL PROTECTED]> wrote: > Is there anywa

RE: SQL Question

2005-07-07 Thread Loathe
; It's SQL Server 2000 btw. > > -Original Message- > From: Loathe [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 07, 2005 10:29 PM > To: CF-Community > Subject: SQL Question > > > Is ther

Re: SQL Question

2005-07-07 Thread Tony Weeg
. > > -Original Message- > From: Loathe [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 07, 2005 10:29 PM > To: CF-Community > Subject: SQL Question > > > Is there anyway to make something like

RE: SQL Question

2005-07-07 Thread Loathe
Oh, It's SQL Server 2000 btw. -Original Message- From: Loathe [mailto:[EMAIL PROTECTED] Sent: Thursday, July 07, 2005 10:29 PM To: CF-Community Subject: SQL Question Is there anyway to make something like this work: insert into application_s

SQL Question

2005-07-07 Thread Loathe
Is there anyway to make something like this work: insert into application_skills ( candidate_id, skill_id, proficiency_id,

RE: dumb sql question

2005-03-02 Thread Nick McClure
n Childress [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 02, 2005 4:19 PM > To: CF-Community > Subject: Re: dumb sql question > > Internally, the grouping may occur in a different order, and the > dataset may be output in a different order. However, in this case the > resulting

Re: dumb sql question

2005-03-02 Thread Cameron Childress
-0500, Nick McClure <[EMAIL PROTECTED]> wrote: > The order is very important, it will group based on the order of those > items. > > > -Original Message- > > From: Cameron Childress [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, March 02, 2005 3:27 PM > >

RE: dumb sql question

2005-03-02 Thread Nick McClure
The order is very important, it will group based on the order of those items. > -Original Message- > From: Cameron Childress [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 02, 2005 3:27 PM > To: CF-Community > Subject: Re: dumb sql question > > I'm pretty su

Re: dumb sql question

2005-03-02 Thread Cameron Childress
I'm pretty sure the order is irrelevant, but it should be easy enough to verify with a couple of CFDUMPs of the result. I've done my fair share of reporting and stats lately, and I'm pretty sure my initial code should work. -Cameron On Wed, 2 Mar 2005 11:54:03 -0600, Raymond Camden <[EMAIL PROT

RE: dumb sql question

2005-03-02 Thread Dawson, Michael
or each *unique* combination of the *values* of the columns specified in the GROUP BY" M!ke -Original Message- From: Raymond Camden [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 02, 2005 11:54 AM To: CF-Community Subject: Re: dumb sql question Hmm, so I thought that when you di

RE: dumb sql question

2005-03-02 Thread Dawson, Michael
02, 2005 11:54 AM To: CF-Community Subject: Re: dumb sql question Hmm, so I thought that when you did GROUP BY A, B, C that it _first_ grouped by A, then B, etc. So if A is the day of the month, it would group all items with the same Day of Mo

Re: dumb sql question

2005-03-02 Thread Raymond Camden
Hmm, so I thought that when you did GROUP BY A, B, C that it _first_ grouped by A, then B, etc. So if A is the day of the month, it would group all items with the same Day of Month, then group by B. Or am i wrong? On Wed, 2 Mar 2005 08:48:11 -0800, Cameron Childress <[EMAIL PROTECTED]> wrote:

Re: dumb sql question

2005-03-02 Thread Cameron Childress
No, I don't think so. They will both have the same day() month(), year(). -Cameron On Wed, 2 Mar 2005 09:28:14 -0600, Raymond Camden <[EMAIL PROTECTED]> wrote: > Won't your group be broken though if two sales occur on the same day > of the month? ~~~

RE: dumb sql question

2005-03-02 Thread Nick McClure
D) FROM Table GROUP by oneDay ORDER BY oneDay > -Original Message- > From: Raymond Camden [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 02, 2005 10:28 AM > To: CF-Community > Subject: Re: dumb sql question > > Sorry, I forgot to say - this is MS Access (yes yes, I kn

Re: dumb sql question

2005-03-02 Thread Raymond Camden
Won't your group be broken though if two sales occur on the same day of the month? On Tue, 1 Mar 2005 18:33:54 -0800, Cameron Childress <[EMAIL PROTECTED]> wrote: > Depending on platform - something like: > > SELECT sum(amount) as sales, day(transdate) + month(transdate) + > year(transdate) > F

Re: dumb sql question

2005-03-02 Thread Raymond Camden
lumn IS NOT NULL > GROUP BY > CONVERT(varchar(10), dateColumn, 105) > ORDER BY > dateColumn > > M!ke > > -Original Message- > From: Raymond Camden [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 01, 2005 8:12 PM > To: CF-Community > Subject: d

Re: dumb sql question

2005-03-01 Thread Cameron Childress
Oh... count... :) Same - but count(somecolumn) :) -Cameron On Tue, 1 Mar 2005 18:33:54 -0800, Cameron Childress <[EMAIL PROTECTED]> wrote: > Depending on platform - something like: > > SELECT sum(amount) as sales, day(transdate) + month(transdate) + > year(transdate) > FROM orders > GROUP BY

Re: dumb sql question

2005-03-01 Thread Cameron Childress
Depending on platform - something like: SELECT sum(amount) as sales, day(transdate) + month(transdate) + year(transdate) FROM orders GROUP BY day(transdate), month(transdate), year(transdate) -Cameron On Tue, 1 Mar 2005 20:11:39 -0600, Raymond Camden <[EMAIL PROTECTED]> wrote: > I want to count

RE: dumb sql question

2005-03-01 Thread Dawson, Michael
dateColumn IS NOT NULL GROUP BY CONVERT(varchar(10), dateColumn, 105) ORDER BY dateColumn M!ke -Original Message- From: Raymond Camden [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 01, 2005 8:12 PM To: CF-Community Subject: dumb sql question I want to count the number of orders per

dumb sql question

2005-03-01 Thread Raymond Camden
I want to count the number of orders per day, where the datetime property has, obviously, a date and time. I want to ignore the time and just get a sum based on date. I know this is simple, but it's been a real long day. -- === R

RE: Quick SQl Question

2004-08-18 Thread Angel Stewart
Yeah, I realised that after I solved the string issue. I did end up doing it in CF..I know its dirty..but there are a number of factors preventing me from redoing the database structure and all the data forms at this time. But hey! We learned how to convert numerics to String succesfully in A

RE: Quick SQl Question

2004-08-18 Thread Angel Stewart
I got it :) You need to use TRIM because MS Access inserts a space infront the value for the sign. So, SELECT tblcasinos.casinoname, tblcasinos.blackjack AS CasinoBlackjack, FROM tblblackjack, tblcasinos WHERE tblcasinos.blackjack = Trim(str(tblblackjack.blackjackid)) Works as if you did a

Re: Quick SQl Question

2004-08-18 Thread Deanna Schneider
Gel, No amount of casting will turn them into the same values. For example "7" will never be "IN" ("7,8,9,10"). The comma-delimted value that you're storing will never be seen as a list, because it's just a string. You'd have to manually loop over the values in the comma delimited list and do a co

RE: Quick SQl Question

2004-08-18 Thread Angel Stewart
mrfff. I just tried this with no luck. SELECT * FROM tblblackjack WHERE str(tblblackjack.blackjackid) IN (Select blackjack from tblcasinos) ORDER BY tblblackjack.blackjackdesc str(tblblackjack.blackkjackid) was supposed to convert the blackjackid value to a string, and then I was hoping t

RE: Quick SQl Question

2004-08-18 Thread Tangorre, Michael
Not sure what approach would suit you best here as I am not a fan of Access for web apps at all, so I have next to no experience writing queries in Access to the degree that would be needed to accomplish what you are trying to do. Perhaps someone else can chime in. I still say that your best approa

RE: Quick SQl Question

2004-08-18 Thread Angel Stewart
*sigh* Well. First problem is that I'm using Microsoft Access. Second problem is that the casinos table has several fields that are meant to collect gametypes. Blackjack,poker,slots,videoslots,tablegames I think. Each of these right now is gathering a comma delimited list of different reco

RE: Quick SQl Question

2004-08-18 Thread Tangorre, Michael
Gel, How did you make out? > Procedure below > CREATE PROCEDURE SELECT_BLACKJACK_TYPES [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

RE: Quick SQl Question

2004-08-17 Thread Michael T. Tangorre
I just tested this out. It is long and somewhat cumbersome, but see how it works in terms of speed. I assume you are on SQL Server, if not, save this snippet for a rainy day. I took a stab from your information at how the tables might look. Adjust accordingly. CASINO: CASINO_ID, CASINO_NAME, BLAC

RE: Quick SQl Question

2004-08-17 Thread Michael T. Tangorre
If you can not modify the tables, or just don't want to... check this article out. http://www.sqlteam.com/item.asp?ItemID=2652 Mike > I'd stop the bus and fix the tables now. Why move forward > with a crappy design. Crap on top of crap equals crap. [Todays Threads] [This Message] [Subscript

RE: Quick SQl Question

2004-08-17 Thread Michael T. Tangorre
I'd stop the bus and fix the tables now. Why move forward with a crappy design. Crap on top of crap equals crap. > Two tables. > > Main tblcasinos table. > Has text field called Blackjack which contains a value list > of blackjack types. Yes..bad way to do it, but it's done. > > Second table t

Re: Quick SQl Question

2004-08-17 Thread Sam Morris
SELECT b.blackjackid, b.blackjackdesc FROM tblblackjack b, tblcasinos c WHERE b.blackjackid = c.blackjack ORDER BY b.blackjackdesc I have no db's runnning at home so I can't test it but you need to convert one of the fields. Oracle I think you could do a WHERE TO_CHAR(b.blackjackid) = c.blackj

Quick SQl Question

2004-08-17 Thread Angel Stewart
Two tables. Main tblcasinos table. Has text field called Blackjack which contains a value list of blackjack types. Yes..bad way to do it, but it's done. Second table tblblackjack, contains the typeid (autonumber) , and the typedescription which is the text that is actually going to be displayed.

Re: quick SQL question

2004-05-10 Thread Phillip B
Ummm sure. That's what it was. A trick question. I can't believe you guys fell for it. Look at the monkey! Beth wrote: > I thought it was a trick question. >   > > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Re: quick SQL question

2004-05-10 Thread BethF
I thought it was a trick question.   - Original Message -   From: Philip Arnold   To: CF-Community   Sent: Monday, May 10, 2004 1:27 PM   Subject: RE: quick SQL question   > From: Phillip B   >   > How do you update an int field to a null value in sql server 2000?   Updat

Re: quick SQL question

2004-05-10 Thread Phillip B
*Smacks head* I was rushing and fogot the myField=  part. Phillip B. Philip Arnold wrote: > > From: Phillip B > > > > How do you update an int field to a null value in sql server 2000? > > Update myTable > Set myField=NULL > Where myOtherField=value > > Difficult, innit? :P [Todays Threads]

Re: quick SQL question

2004-05-10 Thread Ben Doom
update table set field = NULL should do it.  From memory, standard caveats. --BenD Phillip B wrote: > How do you update an int field to a null value in sql server 2000? > > Phillip b > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

RE: quick SQL question

2004-05-10 Thread Philip Arnold
> From: Phillip B > > How do you update an int field to a null value in sql server 2000? Update myTable Set myField=NULL Where myOtherField=value Difficult, innit? :P [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

quick SQL question

2004-05-10 Thread Phillip B
How do you update an int field to a null value in sql server 2000? Phillip b [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

RE: SQL Question

2001-08-21 Thread Rice, John J
3:19 PM To: CF-Community Subject: SQL Question Pretty basic sql question, but, hey, I'm a pretty basic guy! I have a table of people (people a) and a table of uploads with the person's id in it (upload b). I'd like to display the top 10, say, uploaders. What do I use for this??

  1   2   >