Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 5 of 5 total |
Problem defining a default time field. |
Fri, Feb 15 2013 1:58 AM | Permanent Link |
Colin Wood VirtualTec P/L | Hi All,
I'm having a problem trying to create a table which contains 4 time fields. I would like to preset the default times but when I use the code below it returns a #700 Error indicating it expected a Null or time expression but instead found '00:00'. I'm probably missing something obvious but I've been playing around with it for a while now and can't see the problem. Any help appreciated. Regards Colin Query1.SQL.Add('Create Table "Prefs"("PatchNumber" SmallInt,'); Query1.SQL.Add('"BeforeHrsStart" Time Default ' + Quote('00:00')+ ','); Query1.SQL.Add('"BeforeHrsFinish" Time Default ' + Quote('07:59')+ ','); Query1.SQL.Add('"AfterHrsStart" Time Default ' + Quote('16:00')+ ','); Query1.SQL.Add('"AfterHrsFinish" Time Default ' + Quote('23:59')+ ','); Query1.SQL.Add('"UseOutOfHrsMessage" Boolean Default False,'); Query1.SQL.Add('"DisplayMessage" Boolean Default False,'); |
Fri, Feb 15 2013 4:11 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Colin
ElevateDB uses "proper" times so rather than "BeforeHrsStart" Time Default ' + Quote('00:00')+ ','); you'll need something like BeforeHrsStart" Time Default ' + CAST('00:00:00' AS TIME)+ ','); Roy Lambert [Team Elevate] |
Fri, Feb 15 2013 10:04 AM | Permanent Link |
Fernando Dias Team Elevate | Colin,
The correct syntax is: "BeforeHrsStart" TIME DEFAULT TIME '00:00' -- Fernando Dias [Team Elevate] |
Fri, Feb 15 2013 10:09 AM | Permanent Link |
Fernando Dias Team Elevate | Colin,
.... Or, in your case: Query1.SQL.Add('"BeforeHrsStart" Time Default Time ' + QuotedStr('00:00') + ','); -- Fernando Dias [Team Elevate] |
Sun, Feb 17 2013 2:10 AM | Permanent Link |
Colin Wood VirtualTec P/L | Thank you very much gentlemen.
Colin |
This web page was last updated on Saturday, April 27, 2024 at 08:52 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |