Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: SV: Re: SV: Re: Problems counting...


Message #1 by "SD-Studios" <info@s...> on Tue, 9 Apr 2002 18:25:34 +0200
Thanks a lot! =)
--
Martin Johansson,
CEO & Project Supervisor
SD-Studios
+46 (0)70-3003320
http://www.sd-studios.com


-----Ursprungligt meddelande-----
Från: Ken Schaefer [mailto:ken@a...]
Skickat: den 9 april 2002 05:55
Till: ASP Databases
Ämne: [asp_databases] Re: SV: Re: Problems counting...


The problem is this: Your SQL query looks like:

SELECT count(*) as antal FROM Members WHERE date = 9/4/2002

Now 9 divided by 4 divided by 2002 is a very small number, and corresponds
to approximately 1/1/1900 (or something). Instead you need to surround the
date field with # marks to indicate that it is a date literal, not a
mathematical expression to be evaluated:

SELECT Count(*) AS antal FROM Members WHERE Date = #9/4/2002#

Also, you should look at this FAQ on dealing with dates and Access:
www.adopenstatic.com/faq/dateswithaccess.asp

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "SD-Studios" <info@s...>
Subject: [asp_databases] SV: Re: Problems counting...


: First, thanks Bharat, I will try that. Just in case I screw something up I
: think I'd better answer Kens questions.
:
: Currently I'm using Access =), and I'm not getting any error, but the
value
: just turns out 0 even though new members have registered today. I know you
: shouldnt use words like date for this purpose, but it wasnt me designing
the
: db, so I'll just have to blame the one that did it.. However thanks for
: helping out..

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




  Return to Index