experience withh date searching
experience withh date searching
- Subject: experience withh date searching
- From: Gino Pacitti <email@hidden>
- Date: Fri, 1 Jul 2005 10:49:08 +0100
Hi All
Im storing a TIMESTAMP with a record and using
EOUtilities.rawRowsForSQL to retrieve NSDictionaries
In the database the column TIMESTAMP is stored as 2005-06-30 00:59:59
+100 and I am constructing a select statement like this:
SELECT table.name where table.date >= NSTimestamp
This is the code for the creation of NSTimestamp:
NSTimeZone timeZoneNS = NSTimeZone.timeZoneWithName("England/London",
true);
NSTimestamp myNSTimestamp = new NSTimestamp();
GregorianCalendar myCalendar = new GregorianCalendar();
myCalendar.setTime(myNSTimestamp);
int year = myCalendar.get(GregorianCalendar.YEAR);
int dayOfMonth = myCalendar.get(GregorianCalendar.DAY_OF_MONTH);
int monthOfYear = myCalendar.get(GregorianCalendar.MONTH);
timestamp = new NSTimestamp(year, monthOfYear+1, dayOfMonth, 23,
59, 59, timeZoneNS);
yet I get this syntax error - Syntax error or access violation,
message from server: "You have an error in your SQL syntax near
'23:59:59 Etc/GMT' at line 1"
It seems that the timestamp created is wit Etc/GMT additional to
requirement but if I use null for timezone I still get the same.
How do I search for a TIMESTAMP in a sql query?
This is MySQL 3.23.52 on 10.4.1 with WO 5.2.3
I know the rawRowsFor SQL is deprecated but I still have a server
running 5.2.1
Best
Gino
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden