Jillian,
 If you're using DB2 UDB, you can use the date() function to pass in your
date:
 where table_1.expiry_date = date('2005-12-31') ...
 Dina

 On 10/28/05, Dawson, Michael <[EMAIL PROTECTED]> wrote:
>
> Along these lines, you might want to look into DB2's data dictionary.
> On our AS400, you can find the data dictionary in the qsys2 libraries.
> Look for a table named "syscolumns". That table will give you the
> details on any column in the database.
>
> I created a simple DB2 datadictionary view a few years ago and it comes
> in quite handy.
>
> M!ke
>
> -----Original Message-----
> From: Jillian Koskie [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 28, 2005 5:41 PM
> To: CF-Talk
> Subject: RE: OT - Complex SQL
>
> You're so right... Anybody happen to now offhand (I'm off to search
> after I send this message) what the date format is for DB2?
>
> I'm just running this at the command line, so no need for any CF
> stuffs... But unfortuantely also can't take advantage of CF stuffs.
>
> -----Original Message-----
> From: Dawson, Michael [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 28, 2005 4:16 PM
> To: CF-Talk
> Subject: RE: OT - Complex SQL
>
> You need single quotes around "each" of your values in the "IN" clause.
>
> <snip>
> AND table_1.table_id IN ('value1','value2','value3') </snip>
>
> The date formats may be wrong, too. Check the actual data in the
> database and/or use createODBCDateTime() and definitely use
> CFQUERYPARAM. It will make your job a bit eaiser.
>
> Either way, I would remove the dates from your WHERE claus, fix the IN
> clause, then run the query. See if you get any results with very
> limited filtering, first.
>
> Then, go from there and add more filtering as needed.
>
> M!ke
>
> -----Original Message-----
> From: Jillian Koskie [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 28, 2005 5:12 PM
> To: CF-Talk
> Subject: OT - Complex SQL
>
> Okay, I think it's because it is Friday at 4... can somebody help me
> out?
>
> SELECT table_1.expiry_date,
> table_3.expiry_date
> FROM table_3
> JOIN table_2 ON table_2.table2_key = table_3.tablel2_key
> JOIN table_1 ON table_1.table1_key = table_2.table1_key
> WHERE table_1.expiry_date = 'Dec 31, 2005'
> AND table_3.expiry_date = 'Dec 31, 2005'
> AND table_1.table_id IN ('value1,value2,value3')
>
> This isn't returning results, and it should... where is my syntax
> incorrect?
>
> --
> Jillian
>
>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222645
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to