List Info

Thread: problem about the how to save date




problem about the how to save date
user name
2006-11-27 11:29:54
--- In delphi_programers@yahoogroups.com,
"makallousa"
<makallousa...> wrote:
>
> Hi there
> I'm using delphi 7 with sql server 2000
> I have  problem when I try ti insert date into  tble
like this
> Insert into Loan(InvoiceNo,Amount,Notes,LoanDate)
> Values('1','1000','','hi',26/11/2006)
> the data type for loan is datetime
> I found the date sved not "26/11/2006" I
found 01/01/1900 I don't know 
> why
> I tried to change the dt type to nvarchr , It register
the date to the 
> right date but when I tried to do a query to filter the
date between 
> date and date , it don't get the right result
>

Try 
Insert into Loan(InvoiceNo,Amount,Notes,LoanDate)
Values('1','1000','','hi',"26/11/2006")
with quotes " " around the date. otherwise it is
interpreted as a
floating point number 26 divided by 11 divided by 2006 




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http
://groups.yahoo.com/group/delphi_programers/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    
http://groups.yahoo.com/group/delphi_programers/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:delphi_programers-digest@yahoogroups.com 
    mailto:delphi_programers-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    delphi_programers-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )