NewTime = Format(DateDiff("s",StartDate,EndDate),"hh:nn:ss")
The format part may work though I have never tried it. If not, still use the datediff function to get the time interval in seconds then build that into hours minutes and seconds.
mike
OK. This was a question I posted in a crystal forum asking relativily the same question. You will have to modify this slightly for your use but it gets the idea.
mik18 (MIS) Jun 24, 2004
Is there any way to take a date in the form of a week and year (ex. Week 25, 2004) and find the start and...
The DatePart Function allows you to specify the start of the week. In your case Monday. You want to use this function on the FillDate.
DatePart("ww", Filldate, 2) this will return the week number the FillDate occured in.
If you group on this field and count the number of scripts you have what...
You can do this a couple of different ways. The first that comes to mind is to use IIF statements.
SELECT IIF([field 1]="yes",1,0)As One, IIF([field 2]="yes",1,0)As Two, IIF([field 3]="yes",1,0) As Three, One+Two+Three As Total FROM tablename;
mike
...union query to create your crosstab. One line will have default values but you can filter those out later.
This is what I used for mine.
SELECT * FROM qry_Indication_Intervention
UNION ALL SELECT * FROM qry_Medication_Intervention
UNION ALL SELECT 0,"D",0, "D",Drug_Sub_Domain FROM...
The WHERE Clause would need a unique identifier to know which record to pull the TimeIn field from.
If it is in the previous row then you could return the entire dataset, use the rst.Find command to move to the current record, then use the rst.MovePrevious command. Hope this helps.
mike
You can use a recordset to retreive the TimeIn of the previous record.
Dim qry as String
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim v_TimeIn As ???
Set cnn = CurrentProject.Connection
qry = "SELECT TimeIn FROM TableName WHERE criteria match = ??"
rst.open qry,cnn...
Try setting up a linked table(s) to the remote database and using a make table query. After you initially make the table you can just use an append query that captures only unique records to update the local table(s).
mike
If IsNull(combobox) Then
checkbox.Visible = False
Else
checkbox.Visible = True
End If
Set the checkbox' visible property to false by default.
Then insert the above code in the afterupdate event of combobox.
Good Luck
Mike
Why not have use a combo box? You can enter a date on a main form. Then use a tabular subform to select teacher names. Build a combo box that uses the TeacherID as the bound column and then use FirstName & " " & LastName as the second column.
mike
I had the same problem a few months ago and I was told to add that line and it worked. Something with that line makes the script appear in the drop down list.
Well, at least you found what you were looking for.
mike
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.