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!

Calling a value from a table into a form Text Box

Status
Not open for further replies.

mrliam69

Programmer
Jul 21, 2003
75
GB
I am trying to return a value from a table to a Form and Report Text Box Control Source with no luck.

The SQL query is as follows :

SELECT AttendedHours FROM TBLhours WHERE (Date1 = CONVERT DATETIME, '2003-04-29 00:00:00', 102))

for now I would like to see it return attended hours for that date then once I am happy with that I can change the date to a me.datefield

Can anyone help ?


Liam
 
I am not sure what you want, but a valid TransactSQL statement would look something like.

SELECT AttendedHours FROM TBLhours WHERE
convert(varchar(10),Date1,101) = '03/05/2004'

This will look at just the date part of Date1 and ignore the time part.
 
Its not so much the sql statement but the result that I need to appear on a form text box using control source properties.(not linked to the table I want the result from)

Before in access mdb I used dlookup or dsum but I can't get it to work under adp.]

Liam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top