Search code examples
visual-foxpro

Date format in VFP


Hi I have this query in VFP however I don't understand the meaning of it

REPLACE ALL varA WITH YEAR(varB)*100+MONTH(varB)

Can anyone explain why YEAR(varB) is multiply by 100?


Solution

  • Not at a PC to check but it looks like command will store yyyymm as a number. To achieve this, the command will store the year *100 (e.g. 202000) + month (e.g. 10 for October) = 202010. VarA stores a combination of date varB's year() and month () functions, both which return numbers.