Jump to content
Server Maintenance This Week. ×

Simple count sql query not working


This topic is 3736 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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 .

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 3736 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.