I have an excel formula that I need to work in Access. I was thinking it was a straight copy, but must need slightly different formula in Access.
so in excel I have this
cell A1 Cell B1
GS1A1426 62014
Formula in B1
=MONTH(MID(A1,7,2)*7+DATE(MID(A1,5,2),1,1)-2)&"20"&MID(A1,5,2)
So this formula, just reads A1 and positions 5,6,7,& 8 represent the week/year that this item was produced. It then converts it into a month year for reporting purposes. So in this example GS1A1426 = Year 2014 week 26 and converts to 62014.
I change the formula to this in MS Access
productionmonth:MONTH(MID([tblifsreceiptsdetailreport]![serial number],7,2)*7+DATE(MID([tblifsreceiptsdetailreport]![serial number],5,2),1,1)-2)&"20"&MID([tblifsreceiptsdetailreport]![serial number],5,2)
Basically all I did was replace A1 in the formula with field name
[tblifsreceiptsdetailreport]![serial number]. In the access data base field
[tblifsreceiptsdetailreport]![serial number] = GS1A1426
I thought this might work, but it does not. Can anyone explain what I am doing wrong?
so in excel I have this
cell A1 Cell B1
GS1A1426 62014
Formula in B1
=MONTH(MID(A1,7,2)*7+DATE(MID(A1,5,2),1,1)-2)&"20"&MID(A1,5,2)
So this formula, just reads A1 and positions 5,6,7,& 8 represent the week/year that this item was produced. It then converts it into a month year for reporting purposes. So in this example GS1A1426 = Year 2014 week 26 and converts to 62014.
I change the formula to this in MS Access
productionmonth:MONTH(MID([tblifsreceiptsdetailreport]![serial number],7,2)*7+DATE(MID([tblifsreceiptsdetailreport]![serial number],5,2),1,1)-2)&"20"&MID([tblifsreceiptsdetailreport]![serial number],5,2)
Basically all I did was replace A1 in the formula with field name
[tblifsreceiptsdetailreport]![serial number]. In the access data base field
[tblifsreceiptsdetailreport]![serial number] = GS1A1426
I thought this might work, but it does not. Can anyone explain what I am doing wrong?