Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 6 of 6 total |
SQL TimeStamp |
Thu, Oct 19 2006 9:25 AM | Permanent Link |
"Sean M. McDermott" | Hi anyone, I am trying to query a table based on a timestamp field but it
can't parse it. Error says... "Expected column name but found "12/5/2005 11:23 PM" The date and time form is correct from what I can see. Any help? TIA, Sean |
Thu, Oct 19 2006 10:47 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Sean
I think you'll need to use ansi format eg 2005-12-5 (thats yyyy-mm-dd). DBISAM has routines for taking a date or datetime and formatting it "properly" Roy Lambert |
Thu, Oct 19 2006 11:10 AM | Permanent Link |
"Sean M. McDermott" | Thanks Roy.. Sean
"Roy Lambert" <roy.lambert@skynet.co.uk> wrote in message news:66C7208B-4513-4C75-86E9-808535B62F1D@news.elevatesoft.com... > Sean > > > I think you'll need to use ansi format eg 2005-12-5 (thats yyyy-mm-dd). > DBISAM has routines for taking a date or datetime and formatting it > "properly" > > Roy Lambert > |
Mon, Oct 23 2006 5:05 AM | Permanent Link |
"Thomas Eg Jørgensen" | "Sean M. McDermott" <sean@horizoncanada.com> skrev i en meddelelse news:E2D27D88-1185-4E0E-A94E-CF39992F7D0F@news.elevatesoft.com... > Hi anyone, I am trying to query a table based on a timestamp field but it > can't parse it. Error says... "Expected column name but found "12/5/2005 > 11:23 PM" > > The date and time form is correct from what I can see. Any help? TIA, Sean I always use parameters: FQuery.SQL.Clear; FQuery.SQL.Add('INSERT INTO MyTable(MyTimestampColumn)'); FQuery.SQL.Add('VALUES(:MyParameterName)'); FQuery.ParamByName('MyParameterName').value=MyDelphiDateTimeVar; FQuery.ExecSQL; This way you don't have to worry about date formatting...or any other type of formating.... /Thomas |
Mon, Oct 23 2006 5:41 AM | Permanent Link |
"Ian Branch" | Thomas Eg Jxrgensen wrote:
> > This way you don't have to worry about date formatting...or any other type of > formating.... > Now that's sneaky! I like it. Well done. Ian |
Tue, Oct 24 2006 12:09 PM | Permanent Link |
Chris Erdal | "Thomas Eg Jørgensen" <thomas@hest.notaplan.com> wrote in
news:D9631B40-45E2-446B-B3AC-97087456815C@news.elevatesoft.com: > I always use parameters: > FQuery.SQL.Clear; > FQuery.SQL.Add('INSERT INTO MyTable(MyTimestampColumn)'); > FQuery.SQL.Add('VALUES(:MyParameterName)'); > FQuery.ParamByName('MyParameterName').value=MyDelphiDateTimeVar; > FQuery.ExecSQL; > > This way you don't have to worry about date formatting...or any other > type of formating.... but IIRC you need to specify the DataType in certain cases - I've never quite understood why it usually goes OK but sometimes gives an error if you try to assign a value without first setting the datatype. -- Chris (XP-Pro + Delphi 7 Architect + DBISAM 4.24 Build 1) |
This web page was last updated on Tuesday, September 17, 2024 at 04:19 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |