Figured it out. I was missing a join. Should have been:
SELECT DISTINCT phases.phase AS phaseLabel,
narratives.title,
narratives.id,
narratives.content,
phases.id AS phaseId
FROM( ( nsftool.phases2company phases2company
I am having a SQL problem that I'm guessing amounts to me just being brain
dead today but I'd really appreciate any help with this. Here is the query:
SELECT phases.phase AS phaseLabel,
narratives.title,
narratives.id,
narratives.content,
phases.id AS phaseId
FROM
I'm having a weird query issue with SQL server...
The following query inserts two rows into the query_results
table:
insert into ENQUIRE.dbo.QUERY_RESULTS ( QUERYID, ENTITY_ID )
SELECT DISTINCT 1933 AS QUERYID, A.ENTITY_ID
FROM BIOTAB1
Matthew Small wrote:
> I think it's just as simple to say
>
> Select * from table where
> date >= '1/1/2005' and
> date < '3/1/2005'
The query is, but the way you get there dynamically is not, ecause you
have to figure out what the next month is. So if your parameters are 1
2005
I think it's just as simple to say
Select * from table where
date >= '1/1/2005' and
date < '3/1/2005'
- Matt Small
-Original Message-
From: Rick Root [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 17, 2005 11:50 AM
To: CF-Talk
Subj
Charlie Griefer wrote:
> oooh...that's cleaner than mine :)
Maybe, some databases have the gall not to have Month() and Day()
functions... postgres has neither... mysql didn't have Day() until
4.1.something.. although they had DayOfWeek().
Plus, if you want to use indexes, you can't do it the w
Hi Rick,
That is simple. Thanks just what I was looking for
- Original Message -
From: "Rick Root" <[EMAIL PROTECTED]>
To: "CF-Talk"
Sent: Thursday, February 17, 2005 11:26 AM
Subject: Re: OT - Sql Help
> Mickael wrote:
> >
> > select *
oooh...that's cleaner than mine :)
On Thu, 17 Feb 2005 11:26:52 -0500, Rick Root <[EMAIL PROTECTED]> wrote:
> Mickael wrote:
> >
> > select * from table where date between Jan2005 and feb2005 ( so in essence
> > not having to say Jan 1, 2005 and Feb 28, 2005)
>
> How about:
>
> WHERE
>
PROTECTED]
Sent: Thursday, February 17, 2005 10:19 AM
To: CF-Talk
Subject: OT - Sql Help
Hi All,
I am a little stumped with the following task in SQL which seems simple enough
to me. I have a form that my users can select a range of Dates for a
particular report. The range is not day month year
try something like:
SELECT *
FROM table
WHERE date BETWEEN (#createODBCDate(variables.from_date))# AND
#createODBCDate(variables.to_date)#)
btw...i'm hoping 'date' isn't actually your column name. it's a
reserved word and will cause you pain and heartache :)
On Thu, 17 Feb 2005 11:19:29 -050
Mickael wrote:
>
> select * from table where date between Jan2005 and feb2005 ( so in essence
> not having to say Jan 1, 2005 and Feb 28, 2005)
How about:
WHERE
MONTH(date) >= 1 and
YEAR(date) >= 2005) and
MONTH(date) <= 2 and
YEAR(date) <= 2005
~~
Hi All,
I am a little stumped with the following task in SQL which seems simple enough
to me. I have a form that my users can select a range of Dates for a
particular report. The range is not day month year, but month and year and
ending month and year.
In my database I have a date field, it
I'm trying to do a filter for a list of varchars values.
I would like it to work like this but using an "in" instead of "="
fieldname = case when @variable = '0' then fieldname else @variable end
basically if the list is empty do nothing else check the list.
also, do I need to format the c
2
> WHEN age BETWEEN 26 AND 40 THEN 3
> ELSE 4
>END AS [group]
>
>
>
>
>
>
>
>From: Spectrum WebDesign [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, 26 May 2004 8:22 a.m.
>To: CF-Talk
>Subject: [OT] SQL help
You are welcome. ;-)
-Original Message-
From: Monique Boea [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 27, 2004 8:17 AM
To: CF-Talk
Subject: RE: [OT] SQL help
Thanks :)
-Original Message-
From: John Stanley [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 27, 2004 8:13 AM
To
Thanks :)
-Original Message-
From: John Stanley [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 27, 2004 8:13 AM
To: CF-Talk
Subject: RE: [OT] SQL help
Off Topic
-Original Message-
From: Monique Boea [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 27, 2004 8:11 AM
To: CF-Talk
> From: Monique Boea
>
> what is OT?
Off Topic
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
Off Topic
-Original Message-
From: Monique Boea [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 27, 2004 8:11 AM
To: CF-Talk
Subject: RE: [OT] SQL help
what is OT?
-Original Message-
From: Spectrum WebDesign [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 25, 2004 4:22 PM
To: CF
what is OT?
-Original Message-
From: Spectrum WebDesign [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 25, 2004 4:22 PM
To: CF-Talk
Subject: [OT] SQL help
Hi
I have an table were our client save your dob(mm/dd/) in My$QL DB. By
now I need to aggrupate that table queries like this
ND AS [group]
From: Spectrum WebDesign [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 26 May 2004 8:22 a.m.
To: CF-Talk
Subject: [OT] SQL help
Hi
I have an table were our client save your dob(mm/dd/) in My$QL DB. By
now I need to aggrupate that table queries like this:
G
Hi
I have an table were our client save your dob(mm/dd/) in My$QL DB. By now I need to aggrupate that table queries like this:
Group 1: <= 16 years
Group 2: >=17 E <= 25
Group 3: >=26 E <= 40
Group 4: >=41 years
My$SQL give the ages but how to aggrupate in that groups?
Thanx for your time
yes.. permissions are there.
-Original Message-
From: Casey C Cook [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 18, 2004 4:40 PM
To: CF-Talk
Subject: Re: OT: SQL HELP
The ID your using have permissions on the table?
_
[Todays Threads]
[This Message]
[Subscription
The ID your using have permissions on the table?
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
Hello All,
I'm trying to query a table that is on a different server. So I did
something like this:
select *
from server.database.dbo.tablename
Strange thing is that this works on every table in that database except for
one. Everytime I try to query from that table, I get this error:
Mark A. Kruger - CFG wrote:
> What?? what about cursors? This seems pretty easy in SQL if you ask me.
I should have been more specific. You can't do it in SQL in MS
SQL Server. You need to use some non-standard T-SQL facilities.
Jochem
~~~
What?? what about cursors? This seems pretty easy in SQL if you ask me.
-Original Message-
From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 26, 2003 4:08 PM
To: CF-Talk
Subject: Re: OT: SQL help
Michael Hodgdon wrote:
>
> Before I begin, I know this is simp
I am sure this is really easy, but for some reason, I cannot get a handle on
this.
Before I begin, I know this is simple and remedial in CF, but I specifically
want a SQL solution (if necessary, it can be a Transact SQL solution)
Basically, I want to loop over a query using SQL syntax just like
Michael Hodgdon wrote:
>
> Before I begin, I know this is simple and remedial in CF, but I specifically
> want a SQL solution (if necessary, it can be a Transact SQL solution)
>
> Basically, I want to loop over a query using SQL syntax just like you would
> loop over a query using or tags. Tha
I found the solution.
I needed a where statement on the uid field.
where table1.uid = table2.uid
Thanks,
JS
__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
I know there are some smart SQL people on this list,
so I hope someone would be willing to help me with my
problem.
I have 2 tables
table 1
uid | person_id | amount
table 2
table_1_uid | person_id | percentage
I need a way to join these tables to get the
percentage of each amount due to a perso
The problem is that you're using cursors. Cursors in SQL Server are very, very slow.
Come up with an alternate way of doing your import.
- Original Message -
From: Duane Boudreau <[EMAIL PROTECTED]>
Date: Thursday, January 23, 2003 9:02 am
Subject: OT: SQL Help
> Hi Al
nal Message-
From: Matthew Small [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 2:48 PM
To: CF-Talk
Subject: RE: OT - SQL Help
You to see exactly what SQL Statement being sent to the db. How about
displaying the sql string before it is processed and send that to the
list.
tp://ruinworld.sourceforge.net
Scientia Est Potentia
-Original Message-
From: Tony Carcieri [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 11:56 AM
To: CF-Talk
Subject: RE: OT - SQL Help
I just removed all the asp stuff and this is what gets sent.
SELECT * FROM SomeTable WHERE (E
Registered = 1
Matthew Small
IT Supervisor
Showstopper National Dance Competitions
3660 Old Kings Hwy
Murrells Inlet, SC 29576
843-357-1847
http://www.showstopperonline.com
-Original Message-
From: Tony Carcieri [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 2:56 PM
To: CF-T
ssage-
From: Matthew Small [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 2:48 PM
To: CF-Talk
Subject: RE: OT - SQL Help
You to see exactly what SQL Statement being sent to the db. How about
displaying the sql string before it is processed and send that to the
list.
Matthew S
://www.showstopperonline.com
-Original Message-
From: Tony Carcieri [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 2:38 PM
To: CF-Talk
Subject: RE: OT - SQL Help
Exactly!!! But it is not working that way. I just sent a previous email
explaining this.
-Original Message-
From: Dave Watts
Exactly!!! But it is not working that way. I just sent a previous email
explaining this.
-Original Message-
From: Dave Watts [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 2:36 PM
To: CF-Talk
Subject: RE: OT - SQL Help
> Sorry for the OT but this should be a quick ans
L PROTECTED] I should be able to log in but the
problem is that it only accepts the primary email address.
Hope this clears it up.
Thanks,
Tony
-Original Message-
From: Matthew Small [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 2:22 PM
To: CF-Talk
Subject: RE: OT - S
> Sorry for the OT but this should be a quick answer.
> This is in ASP (sorry).
>
> If I have the following:
> sql = "SELECT * FROM SomeTable "
> sql = sql & "WHERE Email = '" & Request("un") & "'"
> sql = sql & " OR SEmail = '" & Request("un") & "'"
> sql = sql & " AND IsDeleted = 0 "
>
:14 PM
To: CF-Talk
Subject: RE: OT - SQL Help
No it did not. It's very bizarre.
-Original Message-
From: Andy Ewings [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 1:04 PM
To: CF-Talk
Subject: RE: OT - SQL Help
my ASP's not what it used to be! - so did Randells po
:14 PM
To: CF-Talk
Subject: RE: OT - SQL Help
No it did not. It's very bizarre.
-Original Message-
From: Andy Ewings [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 1:04 PM
To: CF-Talk
Subject: RE: OT - SQL Help
my ASP's not what it used to be! - so did Randells po
No it did not. It's very bizarre.
-Original Message-
From: Andy Ewings [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 1:04 PM
To: CF-Talk
Subject: RE: OT - SQL Help
my ASP's not what it used to be! - so did Randells post sort it?
-Original Message-
my ASP's not what it used to be! - so did Randells post sort it?
-Original Message-
From: Tony Carcieri [mailto:[EMAIL PROTECTED]]
Sent: 02 December 2002 17:59
To: CF-Talk
Subject: RE: OT - SQL Help
Dave's absolutely right. I am a lil' lazy. The less typin
Dave's absolutely right. I am a lil' lazy. The less typing the better! 8^)
-Original Message-
From: Dave Watts [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 12:56 PM
To: CF-Talk
Subject: RE: OT - SQL Help
> Sorry - I wasn't particularly clear. What I
This and CFDJList are the only good lists that are out there where everyone
is more than helpful and help/answers are extrememly quick.
-Original Message-
From: Rob Rohan [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 12:38 PM
To: CF-Talk
Subject: RE: OT - SQL Help
That is
> Sorry - I wasn't particularly clear. What I meant to
> say was that the request object has a number of
> collections associated with it (form, querystring,
> etc...). When I have used the request object I have
> always referenced an element of one of these collections
> e,g, request.form("un
2002 17:25
To: CF-Talk
Subject: RE: OT - SQL Help
No scope. It is written in ASP.
-Original Message-
From: Andy Ewings [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 11:46 AM
To: CF-Talk
Subject: RE: OT - SQL Help
I'm a bit confused - I'm not sure what you mean b
:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 9:25 AM
To: CF-Talk
Subject: RE: OT - SQL Help
No scope. It is written in ASP.
-Original Message-
From: Andy Ewings [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 11:46 AM
To: CF-Talk
Subject: RE: OT - SQL Help
I'm
No scope. It is written in ASP.
-Original Message-
From: Andy Ewings [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 11:46 AM
To: CF-Talk
Subject: RE: OT - SQL Help
I'm a bit confused - I'm not sure what you mean by the error you are
getting. What scope are you
its using Structure notation.
-Original Message-
From: Andy Ewings [mailto:[EMAIL PROTECTED]]
Sent: 02 December 2002 16:46
To: CF-Talk
Subject: RE: OT - SQL Help
I'm a bit confused - I'm not sure what you mean by the error you are
getting. What scope are you trying to r
ust reference them as "un". Not saying that
what you have will cause errors - just not seen it written like that b4.
-Original Message-
From: Tony Carcieri [mailto:[EMAIL PROTECTED]]
Sent: 02 December 2002 16:31
To: CF-Talk
Subject: OT - SQL Help
Hi all,
Sorry for the OT but this s
You ( ) around your OR statements
Example:
sql = "SELECT * FROM SomeTable "
sql = sql & "WHERE (Email = '" & Request("un") & "'"
sql = sql & " OR SEmail = '" & Request("un") & "')"
sql = sql & " AND IsDeleted = 0 "
sql = sql & " AND Password = '" & Request("pw") & "'"
sql = sql & " AN
Hi all,
Sorry for the OT but this should be a quick answer. This is in ASP (sorry).
If I have the following:
sql = "SELECT * FROM SomeTable "
sql = sql & "WHERE Email = '" & Request("un") & "'"
sql = sql & " OR SEmail = '" & Request("un") & "'"
sql = sql & " AND IsDeleted = 0 "
sql = sq
Sorry for the OT but I'm at a loss on this one.
I've built an application for a Fire/Rescue service to log their calls,
meeting attendance, etc. (geared to small, volunteer agencies). One of the
things that's very important for them is a sum of the hours spent on calls.
Each call record has a uni
Sorry about posting this to the wrong list, but I'm having trouble getting
mail through to the SQL list.
I am running a query to see if there is an entry in the database for an
event that matches certain date criteria. One of the criteria is that one
of the dates that the event is scheduled on d
55 matches
Mail list logo