Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Simple count sql query not working

Featured Replies

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 .

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,...)

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.

  • Author

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

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.