Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: RE: Problems counting...


Message #1 by "Nitai" <nitai@s...> on Mon, 8 Apr 2002 14:51:03 +0530
This is a multi-part message in MIME format.

------=_NextPart_000_0008_01C1DF0C.CDFB88E0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Hi,
Just check out the date format
may be there r some problem

Nitai Mahato
Internet Technologist
Studentsguild.com Pvt. Ltd.
Office : +xx-xx-xxxxxxx
Fax:      +xx-xx-xxxxxxx
Email: nitai@s...
http://www.studentsguild.com/reflex.html
http://www.studentsguild.com
This e-mail, its content and any files transmitted with it are intended
solely for the
addressee(s) and may be legally privileged and/or confidential. Access by
any other party
is unauthorised without the express written permission of the sender. If you
have
received this e-mail in error  you may not copy or use the contents,
attachments or
information in any way. Please destroy it and contact the sender via return
e-mail.

This e-mail has been prepared using information believed by the author to be
reliable and
accurate, but Studentsguild.com Pvt. Ltd. makes no warranty as to its
accuracy or
completeness.  In particular Studentsguild.com Pvt. Ltd. does not accept
responsibility
for changes made to this e-mail after it was sent.

  -----Original Message-----
  From: SD-Studios [mailto:info@s...]
  Sent: Monday, April 08, 2002 2:27 AM
  To: ASP Databases
  Subject: [asp_databases] Problems counting...


  I've been trying to count the number of members registered today. Thought
this would work... but it didn't.

  datum = date

  SQL = "SELECT count(*) as antal FROM Members WHERE date = " & datum

  Please help me out! =) Thanks!
  --
  Martin Johansson,
  CEO & Project Supervisor
  SD-Studios
  +46 (0)70-3003320
  http://www.sd-studios.com


Message #2 by "Bharat Chhabra" <bchhabra@r...> on 8 Apr 2002 04:58:45 -0000
Sorry i forgot to mention earlier
this problem is occuring as datum is carrying a static value. 
(there r no datatypes in asp)
you can use cdate() function also to get ur query into action

On Mon, 08 Apr 2002 SD-Studios wrote :
>I've been trying to count the number of members registered today. 
>Thought
>this would work... but it didn't.
>
>datum = date
>
>SQL = "SELECT count(*) as antal FROM Members WHERE date = " & 
>datum
>
>Please help me out! =) Thanks!
>--
>Martin Johansson,
>CEO & Project Supervisor
>SD-Studios
>+46 (0)70-3003320
>http://www.sd-studios.com
>
>

Message #3 by "Bharat Chhabra" <bchhabra@r...> on 8 Apr 2002 04:55:54 -0000
Try this instead

>SQL = "SELECT count(*) as antal FROM Members WHERE date = 
>getdate())"

Cheers
Bharat



On Mon, 08 Apr 2002 SD-Studios wrote :
>I've been trying to count the number of members registered today. 
>Thought
>this would work... but it didn't.
>
>datum = date
>
>SQL = "SELECT count(*) as antal FROM Members WHERE date = " & 
>datum
>
>Please help me out! =) Thanks!
>--
>Martin Johansson,
>CEO & Project Supervisor
>SD-Studios
>+46 (0)70-3003320
>http://www.sd-studios.com
>
>

Message #4 by "Ken Schaefer" <ken@a...> on Mon, 8 Apr 2002 10:55:33 +1000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "SD-Studios" <info@s...>
Subject: [asp_databases] Problems counting...


: I've been trying to count the number of members registered today. Thought
: this would work... but it didn't.
:
: datum = date
:
: SQL = "SELECT count(*) as antal FROM Members WHERE date = " & datum
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And what is the problem?
Is there an error? Does the query not return the results you expect? What
database product are you using?

(Hints: words like "Date" are usually reserved - eg it is a VB/VBScript/VBA
reserved word, it's *not* a good idea to name variables, or tables, or
fields using reserved words)

Please help us help you!

Cheers
Ken



Message #5 by "SD-Studios" <info@s...> on Sun, 7 Apr 2002 22:56:41 +0200
This is a multi-part message in MIME format.

------=_NextPart_000_0044_01C1DE87.7B355AD0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

I've been trying to count the number of members registered today. Thought
this would work... but it didn't.

datum = date

SQL = "SELECT count(*) as antal FROM Members WHERE date = " & datum

Please help me out! =) Thanks!
--
Martin Johansson,
CEO & Project Supervisor
SD-Studios
+46 (0)70-3003320
http://www.sd-studios.com



  Return to Index