Hi,

On Jun 30, 10:42 am, "Michael Bayer" <mike...@zzzcomputing.com> wrote:
> Mike Driscoll wrote:
>
> > Hi,
>
> > On Jun 30, 8:10 am, Maciej Szumocki <mszumo...@contman.pl> wrote:
> >> I think the problem might be not the query itself, but the date ranges
> >> that get converted using wrong date format. Do you get the same
> >> results if you use real datetime objects instead of strings there?
>
> > I was beginning to think along the same lines, but I tried both
> > datetime.datetime and datetime.date and got the same results.
> > SqlAlchemy never does show what rows it's fetching either, as Bayer
> > said it should. I even tried using SA 0.5.0rc4 just to see if it was
> > some kind of weird regression, but that didn't help either.
>
> build a standalone test script that is entirely outside of the domain of
> your application:
>
> engine = create_engine('<url>', echo='debug')
> engine.execute(<your query>).fetchall()
>
> what do you get ?

That seems to give me all the information including the rows from
November and December that were missing before. That's interesting. I
was trying to remember how to do it using just straight SQL, but I
couldn't find it on the website for some reason. I wonder why my
session doesn't work then...

Here's the SQL it prints out:

2009-06-30 14:13:37,467 INFO sqlalchemy.engine.base.Engine.0x...e5f0
SELECT
 Checks.CHK_DOC_NO,
 Checks.EMP_ID,
 Checks.CHECK_DATE,
 Checks.CHECK_NO,
 Checks.CHECK_AMT,
 Checks.STATUS,
 Checks.PAY_PERIOD,
 Checks.DIRECT_DEPOSIT
FROM
 MyDB.dbo.CheckHistory Checks
WHERE CHECK_DATE BETWEEN '1/1/2007' and '12/31/2007'
ORDER BY Checks.CHECK_DATE DESC


- Mike
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to