Home > database >  The biggest id original concept the current date
The biggest id original concept the current date

Time:10-22

Int p
The select Max (id) into: p
From table
Where to_char (time fields, '- dd yyyy - mm)=' 2016-01-29 ';
Messagebox (p=, p)
Don't know why the calculated result is 0, the biggest id, not the current date

Access database format for datetime, PB12.5
We should be grateful for your new questions

CodePudding user response:

Embedded SQL can only return to a record, you may set of SQL returns exist multiple records

CodePudding user response:

The
refer to the original poster cyril8721 response:
int p
The select Max (id) into: p
From table
Where to_char (time fields, '- dd yyyy - mm)=' 2016-01-29 ';
Messagebox (p=, p)
Don't know why the calculated result is 0, the biggest id, not the current date

Access database format for datetime, PB12.5
Newbie question, appreciate


Messagebox (p=, p) I don't go to the error?
Try this messagebox (p=, string (p))

CodePudding user response:

refer to the second floor smilysoft response:
Quote: refer to the original poster cyril8721 response:

Int p
The select Max (id) into: p
From table
Where to_char (time fields, '- dd yyyy - mm)=' 2016-01-29 ';
Messagebox (p=, p)
Don't know why the calculated result is 0, the biggest id, not the current date

Access database format for datetime, PB12.5
Newbie question, appreciate


Messagebox (p=, p) I don't go to the error?
Try this messagebox (p=, string (p))

Can
Messagebox can automatically turn to string

CodePudding user response:

Has been solved, under the answer yourself,
Reason is the access database can't use to_char
Using the format (field name, 'yyyy - mm - dd) solution

CodePudding user response:

After executing SQL can by examining the SQLCA. Sqlcode=1 examined for errors, and through the SQLCA. Sqlerrtext to prompt

CodePudding user response:


To_char access database have?????

CodePudding user response:

The
refer to the original poster cyril8721 response:
int p
The select Max (id) into: p
From table
Where to_char (time fields, '- dd yyyy - mm)=' 2016-01-29 ';
Messagebox (p=, p)
Don't know why the calculated result is 0, the biggest id, not the current date

Access database format for datetime, PB12.5
Newbie question, appreciate


To_char is in Oracle, access using the convert
  • Related