phpbar.de logo

Mailinglisten-Archive

DatePart in MySQL?

DatePart in MySQL?

Daniel Schmid mysql_(at)_lists.phpcenter.de
Thu, 21 Jun 2001 12:00:41 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0002_01C0FA49.CAF6EA70
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

weiss jemand, wie der SQL Befehl "DatePart" inMySQL 3.23 umgesetzt werden
kann.

hab eine code der mit msaccess oder mssql gut läuft, mit mysql kriegich mit
beiden varianten eine fehlermeldung

1. msaccess:

>select id, title, description, DatePart('h',start_date)as hour, duration

from tasks<

2. mit mssql:

>select id, title, description, DatePart(hour,start_date) as hour, duration


from tasks<

besten dank
daniel schmid
cf-programmer
avguide.ch

------=_NextPart_000_0002_01C0FA49.CAF6EA70
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns=3D"http://www.w3.org/TR/REC-html40" xmlns:o =3D=20
"urn:schemas-microsoft-com:office:office" xmlns:w =3D=20
"urn:schemas-microsoft-com:office:word"><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3DWord.Document name=3DProgId>
<META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR>
<META content=3D"Microsoft Word 9" name=3DOriginator><LINK=20
href=3D"cid:filelist.xml_(at)_01C0F7FE.A58514D0" rel=3DFile-List><!--[if gte =
mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:DoNotRelyOnCSS/>
 </o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:DocumentKind>DocumentEmail</w:DocumentKind>
  <w:HyphenationZone>21</w:HyphenationZone>
  <w:EnvelopeVis/>
 </w:WordDocument>
</xml><![endif]-->
<STYLE>_(at)_page Section1 {size: 595.3pt 841.9pt; margin: 70.85pt 70.85pt =
2.0cm 70.85pt; mso-header-margin: 35.4pt; mso-footer-margin: 35.4pt; =
mso-paper-source: 0; }
P.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; =
mso-style-parent: ""; mso-pagination: widow-orphan; =
mso-fareast-font-family: "Times New Roman"
}
LI.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; =
mso-style-parent: ""; mso-pagination: widow-orphan; =
mso-fareast-font-family: "Times New Roman"
}
DIV.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; =
mso-style-parent: ""; mso-pagination: widow-orphan; =
mso-fareast-font-family: "Times New Roman"
}
P.MsoAutoSig {
	FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; =
mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
LI.MsoAutoSig {
	FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; =
mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
DIV.MsoAutoSig {
	FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; =
mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
SPAN.EmailFormatvorlage15 {
	COLOR: black; mso-style-type: personal-compose; mso-ansi-font-size: =
10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; =
mso-bidi-font-family: Arial
}
DIV.Section1 {
	page: Section1
}
</STYLE>
</HEAD>
<BODY lang=3DDE style=3D"tab-interval: 35.4pt"><![if =
!supportEmptyParas]><![endif]>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001>weiss jemand,&nbsp;wie der SQL Befehl =
"DatePart"=20
inMySQL 3.23 umgesetzt werden kann.</SPAN></FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001></SPAN></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001>hab eine code der mit msaccess oder mssql gut =
l=E4uft,=20
mit mysql kriegich mit beiden varianten eine =
fehlermeldung</SPAN></FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001></SPAN></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001>1. msaccess:</SPAN></FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001></SPAN></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001>&gt;select id, title, description, =
</SPAN></FONT><FONT=20
face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001>DatePart('h',start_date)as=20
hour,&nbsp;duration<BR></SPAN></FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001>from tasks&lt;</SPAN></FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001></SPAN></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001>2. mit mssql:</SPAN></FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001></SPAN></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001>&gt;select id, title, description, =
</SPAN></FONT><FONT=20
face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001>DatePart(hour,start_date) as=20
hour,&nbsp;duration</SPAN></FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001><BR>&nbsp;</DIV></SPAN></FONT>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001>from tasks&lt;</SPAN></FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001></SPAN></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001>besten dank</SPAN></FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001>daniel schmid</SPAN></FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001>cf-programmer</SPAN></FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SPAN=20
class=3D007385209-21062001>avguide.ch</SPAN></FONT></DIV></SPAN></FONT></=
DIV></BODY></HTML>

------=_NextPart_000_0002_01C0FA49.CAF6EA70--

---
!!NEU!!
Fragen und Antworten zu MySQL und dieser Liste unter
-->>  http://www.4t2.com/mysql 



php::bar PHP Wiki   -   Listenarchive