Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Date Field Comparison
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

kolucoms6
Average Member

845 Posts

Posted - 23 March 2008 :  14:08:56  Show Profile
quote:

<% if adrs("cbdate")= Date then Response.write "****" End if %>



cbdate is a datefield.

In my Access, it displays as 21/03/2008.

But above comparison is not working ...

What can be the reason ?

Also,

quote:


<textarea rows="14" name="txtQCRemarks" cols="70"><% = adRsCustInfo("QCRemarks") & Date %></textarea>





I want to insert a break between adRsCustInfo("QCRemarks") and Date.

How to do that ?


Edited by - kolucoms6 on 23 March 2008 14:09:32

HuwR
Forum Admin

United Kingdom
20550 Posts

Posted - 23 March 2008 :  14:21:11  Show Profile  Visit HuwR's Homepage
kolucoms6, you are very good at not giving enough information for people to answer your qusetions which is why you don't get many answers, people just can't be bothered to try and work out what you want.

1) you need to tell us what Date is, and maybe do a response.write Date to see how it displays, your biggest problem is that really you shouldn't store dates in access as date fields and then try and compare them to something other than a date field in access, that is why the forum converts all dates to a string representation befor doing anything with them

2) what do you mean by a break? do you mean a space or a newline ?
Go to Top of Page

kolucoms6
Average Member

845 Posts

Posted - 23 March 2008 :  14:40:31  Show Profile

Excuse me for my confusing words.

1) Currently I am already using "Date" datatype format in current project.

In front end date display as

3/23/2008

In DB it saves as

23/03/2008

2) For "break", below code will work ?

<textarea rows="14" name="txtQCRemarks" cols="70"><% = adRsCustInfo("QCRemarks") & vbCrLf & Date %></textarea>

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20550 Posts

Posted - 23 March 2008 :  14:44:24  Show Profile  Visit HuwR's Homepage
1) that is one of the main reasons not to use date fields, basically your db is saving UK dates but asp is using US dates, you will have to parse them to find out if they are the same.

2) why not just try it rather than asking ?
Go to Top of Page

kolucoms6
Average Member

845 Posts

Posted - 23 March 2008 :  14:50:01  Show Profile

Any way to convert UK date format to US date format using some ASP code/function ?
Go to Top of Page

kolucoms6
Average Member

845 Posts

Posted - 23 March 2008 :  14:53:09  Show Profile

US to UK date format :

strUK = Day(strUS) & "/" & Month(strUS) & "/" & Year(strUS)
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2019 Snitz™ Communications Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000 Version 3.4.07