<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="State"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:1.0cm 1.0cm 1.0cm 1.0cm;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-AU link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>The problem with your condition is that
you are not comparing the right data types. Convert each to a date, using the Cdate()
function (covert to a date datatype), and then compare the results, like below<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=4 color=navy face=Arial><span style='font-size:
14.0pt;font-family:Arial;color:navy'>If CDate(txtDate.Text) <
CDate("1/7/09") Then ……….<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=4 color=navy face=Arial><span style='font-size:
14.0pt;font-family:Arial;color:navy'>It will work fine as I tried it. <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Cheers <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Don<o:p></o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>
<hr size=3 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
sofdev-bounces@edulists.com.au [mailto:sofdev-bounces@edulists.com.au] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Leanne Wright<br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, 21 May 2009 3:51
PM<br>
<b><span style='font-weight:bold'>To:</span></b> Year 12 Software Development
Teachers' M List<br>
<b><span style='font-weight:bold'>Subject:</span></b> [Year 12 SofDev] Date
calculations</span></font><span lang=EN-US><o:p></o:p></span></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 face=Verdana><span
style='font-size:10.0pt;font-family:Verdana'>Can anyone help me with VB6 code
for the following task. My students are working on a program which will allow a
discount on goods purchased before 30th June 2009. I have tried the following
line of code:<br>
<br>
if val(txtDate.text) < #1/7/09# then <br>
etc. etc<br>
<br>
However this gives a discount to dates before and after the cut off date.
I have also tried declaring orderdate as a variable of type date and also
changing 'val' to 'dateval' in the above code but this then gives no
discount at all regardless of the date. I thought this would be simple to code
but am tearing my hair out. Thanks in advance to anyone who can help. Leanne
Wright - <st1:place w:st="on"><st1:City w:st="on">Epping</st1:City> <st1:State
w:st="on">SC</st1:State></st1:place><o:p></o:p></span></font></p>
<div class=MsoNormal align=center style='text-align:center'><font size=2
face=Verdana><span style='font-size:10.0pt;font-family:Verdana'>
<hr size=3 width="100%" align=center>
</span></font></div>
<p class=MsoNormal><font size=2 face=Verdana><span style='font-size:10.0pt;
font-family:Verdana'>Let ninemsn property help <a
href="http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Edomain%2Ecom%2Eau%2F%3Fs%5Fcid%3DFDMedia%3ANineMSN%5FHotmail%5FTagline&_t=774152450&_r=Domain_tagline&_m=EXT"
target="_new">Looking to move somewhere new this winter?</a>_______________________________________________
<br>
<a href="http://www.edulists.com.au">http://www.edulists.com.au </a>IT Software
Development Mailing List kindly supported by <br>
<a href="http://www.vitta.org.au/vce/studies/infotech/softwaredevel3-4.html%20%20">http://www.vitta.org.au/vce/studies/infotech/softwaredevel3-4.html</a>
- Victorian Curriculum and Assessment Authority and <br>
<a href="http://www.vitta.org.au">http://www.vitta.org.au </a>- VITTA Victorian
Information Technology Teachers Association Inc<o:p></o:p></span></font></p>
</div>
</body>
</html>