Hello, I have to find the difference between two date fields. I have a system date which I have defined as Date in my form. I also have a Date Modified field. I want to subtract the Date Field from the date Modified field and get a total days variable. I will use this Total Days variable in an If Statement to determine whether other fields can be changed or not. I do not want any field changed after five days on the form. If the the TotalDays variable equals 5, I will not let any changes be saved. If the TotalDays is less than five, I will let changes be made to fields. Is there a way in VB to do this? agreenvbman
I am trying to use a Sequel Server 2005 database table called CallIssueMain to find the records with DateTimeAdded less than 6 days. I am trying to write the Tsequel coding like this, but getting an error. What is wrong with my coding inside the Query window? The Coding: Declare @EndDate smalldatetime, @StartDate smalldatetime set @StartDate = dateadd(dd,-6,getdate()) set @EndDate = getdate() Select ID, Issue, Resolution, DateTimeAdded,FROM CallIssueMainWHERE User= @UserName and Date between @StartDate and @EndDate The error I get is: ERROR PARSING QUERY.[TOKEN LINE NUMBER = 1, TOKEN LINE OFFSET = 1, TOKEN IN ERROR = DECLARE] ERROR SOURCE: ADO.NET DATA PROVIDER
Looks like its the problem in the Declare statement TOKEN IN ERROR = DECLARE Check if this helps: http://www.experts-exchange.com/Programming/Languages/.NET/Compact_Framework/Q_24479076.html
experts-exchange.com will not allow to see the answer unless you are an expert member or paid member.
Yes, that's true but today after your reply I found something which I didn't noticed earlier If you go to expert-exchange from google it shows you the answer at the bottom of the page, but if you go directly, then it doesn't check the attached page which I got after googling :lol: till now even I was in question whether they have changed the policy or is it just me than I can see the answers. it might be only 2-3 times that I was unable to see the answer, but most of the time I did see. I think google is the reason :rofl:
I never scrolled that down but yes may be may be not. Who cares. I believe in information and knowledge should be open to all.