Jake, Maybe this is what you want??? This pulls all entrydates that are in the submitted list of dates.
SELECT entrydate FROM entries WHERE 1=0 <cfloop list="#datelist#" index="dt"> OR entrydate = #dt# </cfloop> ORDER by entrydate DESC Any closer? Thanks, Joe Kelly On 9/20/05, Joe Kelly <[EMAIL PROTECTED]> wrote: > Jake, > This'll work on MSSQL... > Get the current date, then subtract 5 days, then look for anything newer. > > SELECT entrydate > FROM entries > WHERE entrydate > (GetDate()-5) > > But then I read your email!........ > > The following works for me pulling up the most recent 20 dates of entries. > > SELECT top 20 entrydate > FROM entries > ORDER by entrydate DESC > > Is THIS what you are looking for?? > > Thanks, > Joe Kelly > > On 9/20/05, Jake McKee <[EMAIL PROTECTED]> wrote: > > I tried something similar - > > > > SELECT TOP 5 entrydate > > FROM entries > > WHERE entryDate <= #CreateODBCDateTime(Now())# > > ORDER BY entrydate DESC > > > > > > Really, I want to be able to pull from a list of last five DATES (9/10, > > 8/23, 7/5, etc.) rather than DAYS (as in 9/10, 9/9, 9/8, 9/7, etc.), > > then select entries based on those dates. > > > > When I use the TOP 5 above, it limits the search results (strangely) to > > 5 query results total, rather than say 27 total, under 5 dates. Am I > > making sense? > > > > I'm sure I'm just missing something basic here, but this is driving me > > nuts! :) > > > > Jake > > > > > > > > > > Lewis, David wrote: > > > > >Maybe a subquery is easier, instead of two queries? > > > > > >SELECT * > > >FROM table > > >WHERE dateColumn IN (SELECT dateColumn FROM othertable) > > > > > >-----Original Message----- > > >From: Jake McKee [mailto:[EMAIL PROTECTED] > > >Sent: Tuesday, September 20, 2005 11:15 AM > > >To: Dallas/Fort Worth ColdFusion User Group Mailing List > > >Subject: [DFW CFUG] Date question > > > > > > > > >Let's say I have a valueList that's made up of dates pulled from query > > >1. I want to use that valueList in query 2 like: > > > > > >SELECT * > > >FROM table > > >WHERE dateColumn IN (#valueList#) > > > > > >How would I do that? Right now, I'm getting an error : > > > > > > > > > "2005-09-19 00:00:00.0,2005-09-19 00:00:00.0,2005-09-18 > > > 12:16:50.0,2005-09-18 12:10:09.0,2005-09-18 11:09:02.0" is an invalid > > > date format. > > > > > > > > >Thanks! > > > > > > > > >_______________________________________________ > > >List mailing list > > >Reply to DFWCFUG: > > >[EMAIL PROTECTED] > > >Subscribe/Unsubscribe: > > >http://lists1.safesecureweb.com/mailman/listinfo/list > > >List Archive: > > >http://lists1.safesecureweb.com/mailman/private/list > > > > > >_______________________________________________ > > >List mailing list > > >Reply to DFWCFUG: > > >[EMAIL PROTECTED] > > >Subscribe/Unsubscribe: > > >http://lists1.safesecureweb.com/mailman/listinfo/list > > >List Archive: > > >http://lists1.safesecureweb.com/mailman/private/list > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > List mailing list > > Reply to DFWCFUG: > > [EMAIL PROTECTED] > > Subscribe/Unsubscribe: > > http://lists1.safesecureweb.com/mailman/listinfo/list > > List Archive: > > http://lists1.safesecureweb.com/mailman/private/list > > > -- Thanks, Joe Kelly ---------------------------------------------------------- To post, send email to [email protected] To unsubscribe: http://www.dfwcfug.org/form_MemberUnsubscribe.cfm To subscribe: http://www.dfwcfug.org/form_MemberRegistration.cfm
