I have a query where I need to delete the first four digits and the leading zeros after that. The code is below and I am using the right function to get rid of the first four digits. The issue is the result set could have no 0s, one 0 or 2 0s. How do I eliminate the zeros. I need to do this so I can match it to another number (original journal entry). Here is an example of the possible numbers:
0612001519
0702021566
0712123802
SELECT dbo_gl_history.a_org, dbo_gl_history.a_object, dbo_gl_history.a_project, dbo_gl_history.j_jnl_source, dbo_gl_history.h_effective_date, dbo_gl_history.h_gross_amount, dbo_gl_history.h_ref4_jnl_descsh, Right([h_ref4_jnl_descsh],6) AS Expr1
FROM dbo_gl_history
WHERE (((dbo_gl_history.a_org) Like "3*") AND ((dbo_gl_history.a_object) Like "7*") AND ((dbo_gl_history.a_project)>"0") AND ((dbo_gl_history.j_jnl_source)="GRV"));