sfpx Posted February 3, 2014 Posted February 3, 2014 Sorry for the vague title. Here is the simple statement ExecuteSQL("select count(Distinct Date) from Reports";"";"") The final query is more complicated than that but I simplified it because I know that the problem relies here. This query will return and error ("?") If I create a calculated field Date2 (=Date) and replace it in the query, then the query works. The only thing I can see is that I have other fields named "Date" in other tables but as you can see these other tables are not even in the example query so it's clear that the Date is the on of the table Reports. That must be a simple thing I don't get it .
Wim Decorte Posted February 3, 2014 Posted February 3, 2014 I'm pretty sure that "Date" is a reserved SQL keyword. In general it is a bad idea to name fields with the same name as is commonly used for datatypes (date, number, text,...)
Gastion Posted February 4, 2014 Posted February 4, 2014 Hello, ExecuteSQL("select count(Distinct /"Date/" ) from Reports";"";"") should work... I agree with Wim, Date is a reserved word. , It's better to use dat to name this type of field.
sfpx Posted February 7, 2014 Author Posted February 7, 2014 Hello, ExecuteSQL("select count(Distinct /"Date/" ) from Reports";"";"") should work... I agree with Wim, Date is a reserved word. , It's better to use dat to name this type of field. I had already tried that and it did not work. Anyway, the reserved word explanation makes sense. Thanks
Recommended Posts
This topic is 4009 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now