New topic: Pervasive - how to Cast date String Fields to Date types?
<http://forums.realsoftware.com/viewtopic.php?t=47358> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message tseyfarth Post subject: Pervasive - how to Cast date String Fields to Date types?Posted: Thu Mar 21, 2013 12:29 am Joined: Sat Dec 04, 2010 9:14 pm Posts: 858 Hello all, I need to do searching using fields that hold dates (and times) - in a string format. Can anyone tell me the SQL code to use that will case these properly? Basically these fields are used for sorting and searching. My current code is this: select * from "MGMNT_UPDATE" where "MGMNT_UPDATE"."Date" >= '3/20/2013' and "MGMNT_UPDATE"."Date" <= '3/20/2013' order by "MGMNT_UPDATE"."Date", "MGMNT_UPDATE"."Time" DESC; But I do not know how to change this to make the SQL engine understand it is a date that I am after. Ideas anyone? Thank you, Tim Top timhare Post subject: Re: Pervasive - how to Cast date String Fields to Date typesPosted: Thu Mar 21, 2013 2:20 am Joined: Fri Jan 06, 2006 3:21 pm Posts: 12163 Location: Portland, OR USA SQL doesn't care. Everything is a string in a select statement. You just have to format the string properly, which I thought we had done in a previous post. Something like where "MGMNT_UPDATE"."Date" >= {d '2013-03-20'} Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
