You were on the right track with what you tried, but you needed to use an array formula to make it work. Paste the following (adjust the range references to match your sheets) in the formula bar and then press Ctrl+Shift+Enter.
The Ctrl+Shift+Enter entry enters the formula as an array formula. Array formulas allow you to apply a function to an array of values. In this case, it applies the comparison of A1 to each value in column A on Sheet2. This formula will return an error if no matching invoice number is found.
This formula assumes that the dates on Sheet2 are formatted as Excel dates, i.e., they are a number value represented as a date. If by chance your dates are formatted as Text (not General or a Date format), this formula will not work as intended. In this case, use the formula below entered as an array formula.