Home > Software engineering >  VB to SQL language retrieval records in a certain time
VB to SQL language retrieval records in a certain time

Time:09-25

Using DTPickert controls, format for DTshortdate
Adodc1. RecordSource="select * from the node temperature and humidity information table where date='" & amp; DTPicker1. Value & amp; "'
"Always an error format error, how to write this? Great god!

CodePudding user response:

What is your database?
ACCESS, use the #,
Essentially, use the ',

CodePudding user response:

Adodc1. RecordSource="select * from the node temperature and humidity information table where date=#" & amp; DTPicker1. Value & amp; "#"

CodePudding user response:

Using VFP database

CodePudding user response:

VFP database should be similar to Access database,
Adodc1. RecordSource="select * from the node temperature and humidity information table where date='" & amp; DTPicker1. Value & amp; "'
"Is amended as: (string data is converted to a date in the control data, and the two sides with # beginning and end)
Adodc1. RecordSource="select * from the node temperature and humidity information table where date=#" & amp; CDate (DTPicker1 Value) & amp; "*"

CodePudding user response:

Just got the wrong number:
VFP database should be similar to Access database,
Adodc1. RecordSource="select * from the node temperature and humidity information table where date='" & amp; DTPicker1. Value & amp; "'
"Is amended as: (string data is converted to a date in the control data, and the two sides with # beginning and end)
Adodc1. RecordSource="select * from the node temperature and humidity information table where date=#" & amp; CDate (DTPicker1 Value) & amp; "#" just as the *, cannot be modified after the submission, said no permissions,

CodePudding user response:

reference 1st floor vansoft response:
what is your database?
ACCESS, use the #,
Essentially, to use '

VFP database is to use?

CodePudding user response:

reference 5 floor u013249970 reply:
just dialed the wrong number:
VFP database should be similar to Access database,
Adodc1. RecordSource="select * from the node temperature and humidity information table where date='" & amp; DTPicker1. Value & amp; "'
"Is amended as: (string data is converted to a date in the control data, and the two sides with # beginning and end)
Adodc1. RecordSource="select * from the node temperature and humidity information table where date=#" & amp; CDate (DTPicker1 Value) & amp; "#" just as the *, cannot be modified after the submission, said no permissions,

Adodc1. RecordSource="select * from the node temperature and humidity information table where date=#" & amp; CDate (Text1. Text) & amp; "#", "
It also reported the same mistake

CodePudding user response:

If the data table "date" field is the date/time:
Adodc1. RecordSource="select * from the node temperature and humidity information table where date & gt;=# "& amp; Format (DTPicker1. Value, "yyyy - mm - dd) & amp; "# And date & lt; # "& amp; Format (DTPicker1. Value + 1, "- dd yyyy - mm) & amp; "#", "

SQL engine requirements date value is a valid date string,

CodePudding user response:

No # is single quotes, try to know,
  • Related