some date is not working..

Page 1 of 1

0 Replies - 702 Views - Last Post: 17 November 2009 - 11:29 PM Rate Topic: -----

#1 skannanji  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 14-November 09

some date is not working..

Posted 17 November 2009 - 11:29 PM

Hi experts, [Im new to vb6]

Im using vb 6.0.. Im downloading content from bseindia.. still last month is working.. If i download this month its not working.. I dont know the reason.. Particularly i'm changing the <EQ>, <BE>,<E1>,... as a date.. someway its showing error.. Pl reply here is the code..

Private Sub replace_date_for_main_form()
On Error GoTo err
Dim lOpenFile As Long
  Dim sFileText As String
 Dim sFileName As String
 Dim dte As String
 Dim dte1 As String
 Dim dte2 As String
 Dim days As Integer
 Dim month As Integer
 Dim t1 As String
 Dim t2 As String

 'dte = pass_date_array(ias)
 t1 = ","
 t2 = ","
 
 replace_date_array = replace_date_array + 1
 dte = pass_date_array(replace_date_array)
 days = Day(dte)
 
[b] If days > 9 Then
 dte2 = UCase(Format(dte, "dd-mmm-yyyy"))
 Else
 dte2 = UCase(Format(dte, "d-mmm-yyyy"))
 End If[/b]   {particularly this field is not working for november month.. but its working before months..}

If i changing the code like following, this month working, but, previous months are not working..
[b] If days > 9 Then
 dte2 = UCase(Format(dte, "dd-mmm-yyyy"))
 Else
 dte2 = UCase(Format(dte, "dd-mmm-yyyy")) ///see date
 End If[/b] 

 
 dte1 = Format(dte2, "YYYYMMDD")
 dte1 = t1 & dte1 & t2
 sFileName = replace_date_filename
 lOpenFile = FreeFile
Open sFileName For Input As lOpenFile
sFileText = Input(LOF(lOpenFile), lOpenFile)
Close lOpenFile
 
 sFileText = Replace(sFileText, dte2, "@")

 
sFileText = Replace(sFileText, ",EQ,", dte1)
sFileText = Replace(sFileText, ",BE,", dte1)
sFileText = Replace(sFileText, ",E1,", dte1)
sFileText = Replace(sFileText, ",N1,", dte1)
sFileText = Replace(sFileText, ",N2,", dte1)
sFileText = Replace(sFileText, ",N3,", dte1)
sFileText = Replace(sFileText, ",N4,", dte1)
sFileText = Replace(sFileText, ",P1,", dte1)
sFileText = Replace(sFileText, ",P2,", dte1)
sFileText = Replace(sFileText, ",Q1,", dte1)
sFileText = Replace(sFileText, ",W1,", dte1)
'sFileText = Replace(sFileText, "@,", "@")
'sFileText = Replace(sFileText, "@,", "")
 sFileText = Replace(sFileText, "SYMBOL,SERIES,OPEN,HIGH,LOW,CLOSE,LAST,PREVCLOSE,TOTTRDQTY,TOTTRDVAL,TIMESTAMP,", "")
  lOpenFile = FreeFile
 Open sFileName For Output As lOpenFile
 Print #lOpenFile, sFileText
 Close lOpenFile
err:
End Sub


*** MOD EDIT: Added code tags. Please :code: ***

This post has been edited by JackOfAllTrades: 18 November 2009 - 06:09 AM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1