Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve argument does not match expected type please help...

Status
Not open for further replies.

koopaboy

MIS
May 3, 2010
13
PH
So here's my problem guys i made a program wherein you can search based on the drop down criteria. Like when i search by first name i can search all records that start with the string i type in the textbox along with the criteria.

All of it is going well till i added a new search called datefrom and dateto, the search is by datefrom to dateto but i don't understand is that when i run the program it will keep telling me that retrieve argument does not match expected type but when you see it clearly it is formatted to datetime so how can it be wrong? And the retrieve agrument matches the datatype im searching so it's hard to trace.

dfrom = date(em_fr.text)
dto = date(em_to.text)
cri = trim(sle_criteria.text)

if ddlb_1.text= "Last Name" then
dw_1.retrieve(cri + '%', ' ',nulldate,nulldate,nulldate, nulldate)
elseif ddlb_1.text= "First Name" then
dw_1.retrieve(' ', cri + '%', nulldate, nulldate, nulldate, nulldate)
elseif ddlb_1.text= "Inquiry Date" then
dw_1.retrieve(' ',' ',datetime(dfrom, 00:00:00), datetime(dto, 23:59:59), nulldate, nulldate)
elseif ddlb_1.text= "Target DOR" then
dw_1.retrieve(' ', ' ',nulldate, nulldate, datetime(dfrom, 00:00:00), datetime(dto, 23:59:59))
end if

so basically last name and first name was fine at 1st but when i added datetime along with search it keeps giving me the error msg does not match.

p.s. those 4 are different searches not at the same time, if ddlb_1.text = Target DOR or Inquiry Date

criteria.text will be invisible and dfrom and dto will become visible hope you guys get my idea need help badly thank you :)
 
never mind guys i solved the problem by adding datetime before nulldate, so datetime(nulldate) and i forgot to mention that nulldate was declared as setnull sorry for the mix up thanks for everything guys
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top