Wrong Number of Arguments Used With Function in Query Expression [closed] - sql

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have an SQL in Access 2010 that was written by someone else that gives a Wrong Number of Arguments error when I try and run it. It's supposed to filter a report from a search page.
SELECT Activity.[ProjNo], Activity.[Code], Activity.[Type], Activity.[ProjNoStatus],
Activity.[Preliminary], Activity.[Planner], Activity.[Designer],
Activity.[Officer], Activity.[Manager], Activity.[Staff], Activity.[Analyst],
Activity.[Manager], Activity.[DeptHead], Activity.[ContractNumber],
Activity.[InfoOfficer],Activity.[ProjNoDesigner]
FROM Activity
WHERE Activity.ProjNo=Index.ProjNo AND (((IIf([Forms]![SearchForm]![txtCode]="",
"*",[Activity].[Code]=[Forms]![SearchForm]![txtCode]))<>False)
AND ((IIf([Forms]![SearchForm]![txtType]="","*",[Activity].[ Type]="",
"*", [Activity].[Type]=[Forms]![SearchForm]![txtType]))<>False) AND
((IIf([Forms]![SearchForm]![txtProjNoStatus]="","*",
[Activity].[ProjNoStatus]<=[Forms]![SearchForm]![txtProjNoStatus]))<>False));
I'm not very experienced with SQL and, like I said, I didn't write this code (the person who did has long since retired) so any help would be great.

That query defines just one data source (table or query):
FROM Activity
But then the WHERE clause appears to reference another data source named Index:
WHERE Activity.ProjNo=Index.ProjNo
Since Index is not included in the FROM clause, Access will object when you try to use it in the WHERE clause.
However, I'm not sure that is the cause of the first error Access complains about. It may help to show us the full text of that error message.

Related

Why does insertion command is giving an error about new operator? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
I am bit new this, can someone please help me to rectify this error. I am using sqllite:
The table name in the INSERT is wrong. And the column list must match the values list.
Try INSERT correct table name (target columns) Values (vales for each column).
Additionally if you omit any columns the insert will fail unless they have defaults.

Is there valid statement that don’t return a recordset? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
In the question Difference between a statement and a query in SQL, the accepted answer says:
A statement is any text that the database engine recognizes as a valid command.
and
A query is a statement that returns a recordset (possibly empty).
For example, I know that update and insert can return a recorset when they use a returning clause, so I guess they return an empty returnset in the other case. Also, according to the postgres documentation, the update command returns a “command tag”. But I don’t understand if the tag is attached to an empty recordset or if it’s really all that is returned.
My question is: Considering this list of SQL commands, how do I know which one does not a return a resultset (not even an empty one) and what are they returning instead exactly?
Generally accepted version is that
Query(ies) are select statement which may or may not return rows
but does not make any changes to database.
Statement(s) are instructions when executed and successful will make
changes in the database(after commit)

regular expression for double consonants [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I have a problem writing regular expression. I want to write a regular expression that replaces all double consonants with a single consonant.
Please help me to write such a rule in only one line.
Thanks in advance.
Here's a .NET regex that'll find any group of exactly two non-vowels:
[^aeiou]{2}
The following will work for groups longer than 2:
[^aeiou]{2,}
For example, this will match "llst" in "allstar."
Slightly uglier, but will match groups of 2 consonants, case-insensitive:
[QqWwRrTtYyPpSsDdFfGgHhJjKkLlZzXxCcVvBbNnMM]{2}
The following will match two identical non-vowels:
([^aeiou])\1
For example, this would match the "ll" in "all."
Once you have your regex, just use your chosen language's Regex.Replace function.
Since you did not specify the language, I'm going to go ahead and assume Javascript.
This should get you started:
console.log('babble bubble http htttp www'.replace(/([^aeiou\.,\/=?:\d&\s!##$%^*();\\|<>"'_+-])\1{1}/gi, "$1"));
See more here:
http://regexr.com/3ee47

SQL LIKE doesn't find obvious matches [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I'm writing the following SQL query:
SELECT *
FROM OS
WHERE OS.VERSION LIKE '%1%';
In my table there are rows with char 1 in it. However, it returns an empty result.
I changed a little bit the LIKE clause to different values, but it still doesn't work.
What can I do to fix that?
Try double-quotes and * for wildcards. You are using Oracle syntax instead of Access syntax.
LIKE operation can't be used with columns of integer type. I assume that OS.Version is of integer type?
Edit1:
If you are referring to MS Access then you have to do the LIKE with stars (*) instead of %.

Fulltext index query - illogical [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a fulltext index on my table but am getting weird results...
Think a table of current Toys... (huggle buddy is "hot" apparently at the moment)
If a I search for Huggle on my table the results brought up are "Huggle Buddy" toys and I get 12 results...thats fine, perfect.
But if I search for "Huggle Buddy" I get almost 500 results, which is ok as i know its searching both words and combinations, but, the items with Huggle Buddy in the title do not appear first, how do i fix that? e.g. Is there an order by scoring?
Put the search term in quotes so it will only search for an exact match. You'll only get results that contain the exact match "Huggle Buddy".