Home > database >  Please look at the statement error, isn't it quotes statements
Please look at the statement error, isn't it quotes statements

Time:09-29

I write in the clicked event of cb_1:
Int sj,
KSRQ=strin (sle_1. Text)
JSRQ=strin (sle_2. Text)

Select count (*) into: sj from test where
To_char (sj_date, 'yyyymmdd') & gt;="+ STRING (KSRQ) +"
And to_char (sj_date, 'yyyymmdd') & lt;="+ STRING (JSRQ) +"

Don't save, prompt syntax errors, everybody to look at the problem that is there, is the problem that quote?

CodePudding user response:

What is the function strin?
SQL statements can only be used in the SQL function, cannot use PB function

CodePudding user response:

Int sj,
KSRQ=string (sle_1. Text)
JSRQ=string (sle_2. Text)

Select count (*) into: sj from test where
To_char (sj_date, 'yyyymmdd') & gt;="+ KSRQ +"
And to_char (sj_date, 'yyyymmdd') & lt;="+ JSRQ +"
This also not line, an error

CodePudding user response:

Select count (*) into: sj from test where
To_char (sj_date, 'yyyymmdd') & gt;=: KSRQ
And to_char (sj_date, 'yyyymmdd') & lt;=: JSRQ;
//advice first take a look at a book club

CodePudding user response:

Int sj
String KSRQ, JSRQ
KSRQ=string (sle_1. Text, "yyyymmdd")
JSRQ=string (sle_2. Text, "yyyymmdd")

Select count (*) into: sj from test where the convert (char, sj_date, 112) & gt; KSRQ="+ +" and the convert (char, sj_date, 112) & lt;="+ JSRQ +"

CodePudding user response:

Select count (*) into: sj from test where the convert (char, sj_date, 112) & gt;=: ksrqand convert (char, sj_date, 112) & lt;=: JSRQ

CodePudding user response:

The
refer to the original poster wisetiger posts:
I wrote in the clicked event of cb_1:
Int sj,
KSRQ=strin (sle_1. Text)
JSRQ=strin (sle_2. Text)

Select count (*) into: sj from test where
To_char (sj_date, 'yyyymmdd') & gt;="+ STRING (KSRQ) +"
And to_char (sj_date, 'yyyymmdd') & lt;="+ STRING (JSRQ) +"

Don't save, prompt syntax errors, everybody to look at the problem that is there, is the problem that quote?


String KSRQ JSRQ//if the date format for sle yyyymmdd
KSRQ=sle_1. Text
JSRQ=sle_2. Text
Select count (*) into: sj from test where
Convert (varchar (8), sj_date, 112) & gt;=: KSRQ and convert (varchar (8), sj_date, 112) & lt;=: JSRQ


CodePudding user response:

Can't write in PB SQL syntax

'KSRQ' and 'JSRQ' should be variable

Pb is expressed as: KSRQ, : JSRQ
And '+ string (KSRQ) +', '+ string (JSRQ) +' for the SQL syntax

CodePudding user response:

Ha ha:
String KSRQ JSRQ//if the date format for sle yyyymmdd
KSRQ=sle_1. Text
JSRQ=sle_2. Text
Select count (*) into: sj from test where
Convert (varchar (8), sj_date, 112) & gt;=: KSRQ and convert (varchar (8), sj_date, 112) & lt;=: JSRQ

-- -- -- -- --
What you said is what I mean, but such or grammatical errors, whether in pb, put the date into 'yyyymmdd' have another function?

CodePudding user response:

String KSRQ JSRQ//if the date format for sle yyyymmdd
KSRQ=sle_1. Text
JSRQ=sle_2. Text
Select count (*) into: sj from test where
Sj_date between to_date (: KSQR, 'yyyymmdd') and to_date (' JSRQ ', 'yyyymmdd')

Or go back more than reading a book, of course, if not this to have a meal, it doesn't matter

CodePudding user response:

Remember the 'JSRQ: JSRQ

CodePudding user response:

The to sjlion:

String KSRQ JSRQ//if the date format for sle yyyymmdd
KSRQ=sle_1. Text
JSRQ=sle_2. Text
Select count (*) into: sj from test where
Sj_date between to_date (: KSQR, 'yyyymmdd') and to_date (: JSRQ, 'yyyymmdd')


Or prompt syntax!
Is the book, can't find just ask ah

CodePudding user response:

What database do you use?

CodePudding user response:

Please indicate the original poster posted an error prompt

CodePudding user response:

If, in accordance with the original poster that a few words in fact there are several grammatical mistakes

CodePudding user response:

 select count (*) into: sj from test where the convert (varchar (8), sj_date, 112) & gt;=: KSRQ and convert (varchar (8), sj_date, 112) & lt;=: JSRQ; 
  • Related