Based on my previous question, [VB.net SQL statement to query 1 yr old Timestamp](https://stackoverflow.com/questions/33586341/vb-net-sql-statement-to-query-1-yr-old-timestamp) , my SQl query to look back a year of records gets stopped half way with the following error: `Select Error: ORA-01830: date format picture ends before converting entire input string`.

Therefore, I decided to do a different route to rows that are not older than a year from current date.

To do this I will make the following SELECT statement in VB.net:

```
Dim strSearch As String = "Select timestampVal from table_name WHERE timestampVal > " & minusYear & " order by timestampVal DESC"

```

For my `minusYear` variable in my SELECT statement, I will first pull the following current date string:

```
Dim sign As String = DateTime.Now.ToString("yyyyMMdd-hhmmss")

```

However, to get `minusYear` I need to somehow minus a year from `sign`.

I tried `Dim minusYear As String = DateTime.Now.AddYears(-1)`; however it formats it like so `MM\DD\YYYY HH:MI:SS PM` which won't work since I need to query where the string looks like `yyyyMMdd-hhmmss`.

**Is there a way to simply minus 1 year from my sign string?** I try to but there is of course datatype issues and converting the string to `CInt` doesn't really work.

If I can get the 1 year minus sign to get `minusYear`, then my select statement works [I have tested it in SQL so this way will work, I just need to get `sign's` value minus a year]