W
wrightlife11
Hello, I have a problem with data type mismatch. Can someone assist me
please?
I have some basic date functions below. I keep getting a data type
mismatch. What can I do about it? I need to calcuate the number of days
between dates.
However when I use the Like 1 it will show up as all those with a 1.
I tried this query first:
SELECT MORDDate([SFStartDate]) AS MatOrdDate, Date() AS [Date],
CDbl(Dinq([SFStartDate],Date())) AS DaysPastMord
FROM tblMain
WHERE (((CDbl(Dinq([SFStartDate],Date())))<=1) AND ((tblMain.SFStartDate) Is
Not Null))
ORDER BY tblMain.SFStartDate;
Then I tried a query of a query like this:
SELECT
FROM qryX54DinQ
WHERE (((qryX54DinQ.DaysPastMord) <= 1));
and lastly I tried to use the Dinq function like this:
SELECT Dinq(TargetDate([SFStartDate]),Date()) AS Dinq
FROM qryX54DinQ
WHERE (((qryX54DinQ.DaysPastMord) Like -30) AND
((Dinq(TargetDate([SFStartDate]),Date()))<=1));
Example:
Public Function TargetDate(StartDate As Date) As Date
If StartDate < 0 Then 'Evaluate Argument
Exit Function
Else
TargetDate = StartDate - 7
End If
End Function
and
Public Function Dinq(StartDate As Date, EndDate As Date) As Double
If StartDate < 0 Then 'Evaluate Argument
Exit Function
Else
Dinq = EndDate - StartDate
End If
End Function
please?
I have some basic date functions below. I keep getting a data type
mismatch. What can I do about it? I need to calcuate the number of days
between dates.
However when I use the Like 1 it will show up as all those with a 1.
I tried this query first:
SELECT MORDDate([SFStartDate]) AS MatOrdDate, Date() AS [Date],
CDbl(Dinq([SFStartDate],Date())) AS DaysPastMord
FROM tblMain
WHERE (((CDbl(Dinq([SFStartDate],Date())))<=1) AND ((tblMain.SFStartDate) Is
Not Null))
ORDER BY tblMain.SFStartDate;
Then I tried a query of a query like this:
SELECT
FROM qryX54DinQ
WHERE (((qryX54DinQ.DaysPastMord) <= 1));
and lastly I tried to use the Dinq function like this:
SELECT Dinq(TargetDate([SFStartDate]),Date()) AS Dinq
FROM qryX54DinQ
WHERE (((qryX54DinQ.DaysPastMord) Like -30) AND
((Dinq(TargetDate([SFStartDate]),Date()))<=1));
Example:
Public Function TargetDate(StartDate As Date) As Date
If StartDate < 0 Then 'Evaluate Argument
Exit Function
Else
TargetDate = StartDate - 7
End If
End Function
and
Public Function Dinq(StartDate As Date, EndDate As Date) As Double
If StartDate < 0 Then 'Evaluate Argument
Exit Function
Else
Dinq = EndDate - StartDate
End If
End Function