@renada ,
It would work better as:
"I was in New York City two weeks ago."
or
"I have been in New York City."
or
"I have visited New York City in the past."
Sorry I can't tell you the specifics of what is wrong, but you're correct that it's wrong. (By the way the second part of your question should read; "I was wondering what is wrong with this sentence.")