>From: "sql language digest" <sql_language@p...>
>Reply-To: "sql language" <sql_language@p...>
>To: "sql_language digest recipients" <sql_language@p...>
>Subject: sql_language digest: November 07, 2001
>Date: Thu, 08 Nov 2001 00:03:06 -0000
>
>SQL_LANGUAGE Digest for Wednesday, November 07, 2001.
>
>1. Re: Case Statements And Tangents
>2. Re: Case Statements And Tangents
>3. RE: formatting date returned from sql server
>4. RE: formatting date returned from sql server
>5. Re: formatting date returned from sql server
>6. shape...compute command
>
>----------------------------------------------------------------------
>
>Subject: Re: Case Statements And Tangents
>From: "Ken Schaefer" <ken@a...>
>Date: Wed, 7 Nov 2001 11:52:34 +1100
>X-Message-Number: 1
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>From: "William Markham" <William.Markham@p...>
>Subject: [sql_language] Case Statements And Tangents
>
>
>: First: The TAN function.
>: I am trying to transform a typical coordinate system into headings
>: with -y being the 0/360 degree mark. Is there a way to make the TAN
>: function work with angle over 180 degrees
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>Have you looked in a maths text? Tan gives you the ratio of the opposite
>side to the adjacent side of a right angle triangle. Tan(180) should give
>you infinity, since the opposite = hypotenuse, and the adjacent side has a
>length of 0. Try drawing this triangle on a piece of paper and you'll see
>what I mean.
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>: Second: The CASE statements.
>: Is there a way to use a case statement to check anything
>: other than a direct value. What I mean to ask is can I use
>: the "< >" operators? Or is it possible to use "if" statements
>: in a select statement?
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>You can use If statements within a CASE, but it seem more like you want an
>ELSE statement:
>
>CASE doodah
> WHEN foo
> WHEN bar
> ELSE -- (everything else - this is your <> part)
>END
>
>Cheers
>Ken
>
>
>
>----------------------------------------------------------------------
>
>Subject: Re: Case Statements And Tangents
>From: "Ken Schaefer" <ken@a...>
>Date: Wed, 7 Nov 2001 13:32:06 +1100
>X-Message-Number: 2
>
>: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>: From: "William Markham" <William.Markham@p...>
>: Subject: [sql_language] Case Statements And Tangents
>:
>:
>: : First: The TAN function.
>: : I am trying to transform a typical coordinate system into headings
>: : with -y being the 0/360 degree mark. Is there a way to make the TAN
>: : function work with angle over 180 degrees
>: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>:
>: Have you looked in a maths text? Tan gives you the
>: ratio of the opposite side to the adjacent side of a right angle
>: triangle. Tan(180) should give you infinity, since the opposite
>: hypotenuse, and the adjacent side has a length of 0. Try drawing
>: this triangle on a piece of paper and you'll see what I mean.
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>I should probably clarify what I mean here (and correct myself). Tan(180)
>gives you both positive and negative infinity.
>
>You can also get the Tan(x) where x > 180. What you need to bear in mind is
>that the values that Tan(x) returns varies from negative infinity to
>positive infinity as you move from -180 deg to +180 deg, then the cycle
>starts again.
>
>If you are having problems with whatever code you have (which you haven't
>given), you might want to change your x value to a value between -180 and
>180 by subtracting 360 deg until the value is between -180 and 180, then
>calculating the tan(), as the value will be the same.
>
>Cheers
>Ken
>
>
>----------------------------------------------------------------------
>
>Subject: RE: formatting date returned from sql server
>From: "Ken Schaefer" <ken@a...>
>Date: Wed, 7 Nov 2001 13:33:25 +1100
>X-Message-Number: 3
>
>You can also use DatePart() and DateName()
>
>Cheers
>Ken
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>From: "David Cameron" <dcameron@i...>
>Subject: [sql_language] RE: formatting date returned from sql server
>
>
>: If you are using SQL Server then you have access to CONVERT. Otherwise I
>: suggest you write yourself some string manipulation functions.
>:
>:
>: -----Original Message-----
>: From: bmcelhany@h... [mailto:bmcelhany@h...]
>: Sent: Wednesday, 7 November 2001 7:56 AM
>: To: sql language
>: Subject: [sql_language] formatting date returned from sql server
>:
>:
>: When I display a date/time field on an ASP page that is the result of a
>: SQL query, the date always is displayed as something like: Mon Jan 1
>: 00:00:00 PST 2001. How do I get it to display as something like 1/1/2001?
>:
>: By the way, I am doing my ASP coding using JavaScript, so I'd like to
>stay
>: away from any VBScript solutions if possible.
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>----------------------------------------------------------------------
>
>Subject: RE: formatting date returned from sql server
>From: "Tomm Matthis" <matthis@b...>
>Date: Wed, 7 Nov 2001 08:28:40 -0500
>X-Message-Number: 4
>
>Use the TSQL CONVERT function in the SELECT query to format the field the
>way
>you want.
>
>--Tomm
>
> > -----Original Message-----
> > From: bmcelhany@h... [mailto:bmcelhany@h...]
> > Sent: Tuesday, November 06, 2001 9:56 PM
> > To: sql language
> > Subject: [sql_language] formatting date returned from sql server
> >
> >
> > When I display a date/time field on an ASP page that is the result of a
> > SQL query, the date always is displayed as something like: Mon Jan 1
> > 00:00:00 PST 2001. How do I get it to display as something like
>1/1/2001?
> >
> > By the way, I am doing my ASP coding using JavaScript, so I'd like to
>stay
> > away from any VBScript solutions if possible.
> >
> > Thanks in advance!
> >
> > Brian
> >
>$subst('Email.Unsub')
> >
> >
>
>
>----------------------------------------------------------------------
>
>Subject: Re: formatting date returned from sql server
>From: "Enzo Zaragoza" <enzaux@g...>
>Date: Wed, 7 Nov 2001 22:44:09 +0800
>X-Message-Number: 5
>
>
>This is a multi-part message in MIME format.
>
>------=_NextPart_000_005F_01C167DD.B70F9690
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
>Use FormatDateTime(rsSQLResult.Fields("MyDate"))
>
>Enzo
> ----- Original Message -----
> From: bmcelhany@h...
> To: sql language
> Sent: Tuesday, November 06, 2001 9:55 PM
> Subject: [sql_language] formatting date returned from sql server
>
>
> When I display a date/time field on an ASP page that is the result of
>a
> SQL query, the date always is displayed as something like: Mon Jan 1
> 00:00:00 PST 2001. How do I get it to display as something like
>1/1/2001?
>
> By the way, I am doing my ASP coding using JavaScript, so I'd like to
>stay
> away from any VBScript solutions if possible.
>
> Thanks in advance!
>
> Brian
>
>$subst('Email.Unsub')
>
>
>------=_NextPart_000_005F_01C167DD.B70F9690
>Content-Type: text/html;
> charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
><HTML><HEAD>
><META http-equiv=3DContent-Type content=3D"text/html;
>charset=3Diso-8859-1">
><META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR>
><STYLE></STYLE>
></HEAD>
><BODY bgColor=3D#ffffff>
><DIV><FONT face=3DVerdana size=3D2>Use
>FormatDateTime(rsSQLResult.Fields("MyDate"))</FONT></DIV>
><DIV><FONT face=3DVerdana size=3D2></FONT> </DIV>
><DIV><FONT face=3DVerdana size=3D2>Enzo</FONT></DIV>
><BLOCKQUOTE
>style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px;
>BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
> <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
> <DIV
> style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color:
>black"><B>From:</B>
> <A title=3Dbmcelhany@h...
> href=3D"mailto:bmcelhany@h...">bmcelhany@h...</A> </DIV>
> <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A
>title=3Dsql_language@p...
> href=3D"mailto:sql_language@p...">sql language</A> </DIV>
> <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Tuesday, November 06,
>2001 9:55
> PM</DIV>
> <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [sql_language]
>formatting date
> returned from sql server</DIV>
> <DIV><BR></DIV>When I display a date/time field on an ASP page that is
>the
> result of a <BR>SQL query, the date always is displayed as something
>like: Mon
> Jan 1 <BR>00:00:00 PST 2001. How do I get it to display as something
>like
> 1/1/2001?<BR><BR>By the way, I am doing my ASP coding using
>JavaScript, so I'd
> like to stay <BR>away from any VBScript solutions if
>possible.<BR><BR>Thanks
> in advance!<BR><BR>Brian<BR><BR>---<BR>You are currently subscribed to
>
> sql_language as: <A
>href=3D"mailto:enzaux@g...">enzaux@g...</A><BR>To
> unsubscribe send a blank email to <A
>
>href=3D"mailto:$subst('Email.Unsub')">leave-sql_languag
>e-647264F@p...</A><BR></BLOCKQUOTE></BODY></HTML>
>
>------=_NextPart_000_005F_01C167DD.B70F9690--
>
>
>----------------------------------------------------------------------
>
>Subject: shape...compute command
>From: bmcelhany@h...
>Date: Wed, 7 Nov 2001 22:05:30
>X-Message-Number: 6
>
>I'm going to drive people here crazy with all of my questions! Here's
>another one...I want to create an ASP page that displays both summary and
>aggregate data from a query (everything comes from one table). Something
>like:
>
> Name-------Application #-----Decision
> Person 1---123456------------approved
> Person 2---234567------------approved
> Person 3---345678------------approved
> Total approved apps:---------3
> Person 4---456789------------denied
> Person 5---567890------------denied
> Total denied apps:-----------2
>
>I have been researching ADO's datashaping capabilites, specifically the
>shape...compute clause. It seems to make sense, but I am having problems
>figuring out how to actually implement in in an ASP page (how to actualy
>display the returned data). Any ideas?
>
>Brian
>
>
>
>---
>
>END OF DIGEST
>
>
>$subst('Email.Unsub')
>
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp