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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need specific dates in report - is a function the solution?

Status
Not open for further replies.

punderful

Programmer
Dec 14, 2002
28
US
I have a database for project management, with a table for the project itself, and a table to record the activities, with multiple dates for each activity. My problem is that I need to pick one of the dates for a specific activity to display in a report field, then another date for a specific activity in another report field.

I'm thinking the best way to do this is to use a query to isolate the specific dates, and have been struggling with the dlookup. When I add a field to my query that asks for dtmCompleteDate only for the record that contains a txtTaskDesc with the value "aewalk" it gives a value of 5.1150895140665E. If I then add the format function to convert it to a date it gives me a date but the date is totally off, and every row produced in the query gives the same date value even though the values in the table are different.

I am thinking now that I might need to create a function for each of these required report dates that isolates those specific dates, and use the functions to produce the query that I use for my report(s) data.

The dlookup I am using is
DelivDate: DLookUp([dtmDeliverDate],"tblChangeOrder",[txtTaskDesc]="aewalk")

I am using Access2002 at work, and 2000 at home, but I don't think that should matter. Unfortunately the only book I have is '97, and that doesn't help at all in building the function in creating a recordset.

Any help or suggestions are appreciated. Why is my dlookup converting the date (I am using short date in the table)?
 
Just a thought but could you not use something like the integral "Format" function?

Something like: format(Now, DD MM YYYY) & format(Now, DDDD MMMM YYYY)?

(You'll have to check the correct syntax - I forget off the top of my head. You could also replace 'Now' for your date field)

Hope this helps....

asjeff
 
I have used the format function:

results:format(DLookUp([dtmDeliverDate],"tblChangeOrder",[txtTaskDesc]="aewalk"),m/d/yy)

The results I get in my query is 12/30/99 in all the fields, thought the correct date in the table is varied, and none of the records have the date 12/30/99. I don't understand why it's converting the date in the first place.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top