yyyy/mm/dd
SELECT * FROM qryContLife WHERE 1=1 AND [Depot In Date] Between #2008/05/01# And #2008/07/30#
mm/dd/yyyy
SELECT * FROM qryContLife WHERE 1=1 AND [Depot In Date] Between #05/01/2008# And #07/30/2008#
Both textboxes are formatted to short date. Currently in both cases in...
Didn't help, returns 2 weird values out of like a 100 possible. The thing is that even if I run the 2003 version in 2007 access it works fine, but if in 2003 it doesn't work.
...to convert it to 2003. I have a line of code which returns a requested date range from a query to a listbox:
Dim MySQL As String
MySQL = "SELECT * FROM qryContLife WHERE 1=1"
If IsDate(Me![StartDate]) And IsDate(Me![EndDate]) Then
If CDate(Me![StartDate]) < CDate(Me![EndDate]) Then...
DepotFee: IIf(Not IsNull([Depot Out Date]),
DatePart("d",[Depot In Date])*[Storage Fee/Day],
IIf(DateDiff("d",[Depot In Date],
Date())<31,DateDiff("d",[Depot Out Date],Date())*[Storage Fee/Day],
31*[Storage Fee/Day]))
Solved i guess ;) thanks
...to calculate the storage fees of containers
The logic behind the formula is - If [Depot Out] IsNotNull then datediff("d",[Depot In],[Depot Out])*[Storage Fee] ... now here's the trouble: the statement divides into 2 more ifs - if [Depot Out] IsNull and datediff("d",[Depot In],Date())<31 then...
right guys, thanks for the great help, managed to do it with this function:
DepotFee: IIf(DateDiff('d',[Depot In Date],Date())>31,31*[Storage Fee/Day],DateDiff('d',[Depot In Date],Date())*[Storage Fee/Day])
Have a little problem left. On my input form I have a combobox to input the...
I'm trying to run this from an independant form. It is easy to run it in a query, but I need a a function in vba that will make calculations based on the datediff values ;(
Am i getting this through ? ;(
Hello everyone. I've recieved wonderful help last time when i turned to this forum, now i have another problem and hoping you will help a beginner again.
I have a table with containers. Each container has an arrival date. I am trying to make a function using DateDiff to calculate the difference...
yay, we're on the right track, it works with simultaneous searches, this is the output:
SELECT * FROM qryContLife WHERE 1=1 and [Status] Like 'RM*' AND [Depot In Date] Between #05/01/2008# And #01/05/2008#
and it gets shown in the listbox, but the dates are weird.
I input from 05/01/2008...
...said, left 1 if statement at the beggining of the Addwtf sub, haven't changed anything in the button sub, this is whats the output like:
SELECT * FROM qryContLife WHERE 1=1 [Container Number] Like '*'[OwnerCode] Like '*'[Arrival Date] = '*'[Depot In Date] = '*'[Container Size] Like...
...As String, mycriteria As String, MyRecordSource As String
Dim argcount As Integer
Dim Tmp As Variant
mycriteria = " "
argcount = 0
MySQL = "SELECT * FROM qryContLife WHERE 1=1"
Addwtf [myd1], "[Container Number]", mycriteria, argcount, "myd1"
Addwtf [myd2], "[OwnerCode]", mycriteria...
...your suggestion is that the function takes all the fields no matter whether they r empty or not, the output in this case looks like this:
SELECT * FROM qryContLife WHERE 1=1 and [Container Number] Like '*' and [OwnerCode] Like '*' and [Arrival Date] Equals '*' and [Depot In Date] Equals...
SELECT * FROM qryContLife WHERE 1=1 AND [Depot In Date] Between #2008/05/01# And #2008/07/01#
this is what i get if i just input the date range, and I get the values in the listbox, but as soon as I add something else to the search, Container Size or Status, the listbox is blank.
...As String, mycriteria As String, MyRecordSource As String
Dim argcount As Integer
Dim Tmp As Variant
mycriteria = " "
argcount = 0
MySQL = "SELECT * FROM qryContLife WHERE 1=1"
Addwtf [myd1], "[Container Number]", mycriteria, argcount, "myd1"
Addwtf [myd2], "[OwnerCode]", mycriteria...
Right, what I experiece when I search for a date range and other values.
When I search for a date range, the output is this :
SELECT * FROM qryContLife WHERE 1=1 AND [Depot In Date] Between #05/01/2008# And #01/07/2008# AND [Depot In Date] Between #2008/01/05# And #2008/07/01#
And the...
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.